Forum Discussion

ZairossH's avatar
ZairossH
New Contributor
11 months ago

Error "Unable to obtain the item's rectangle." when Keys Action on Object

I run keyword test login main page

 

Step 1: Direct to login page

Step 2: Input user/password

Step 3: Click "Login" button

Step 4: Wait and check direct to main page

 

After exceed waiting time, Action step 5

Step 5: ENTER(Keys Action) into password textbox(the same action click Login button) 

 

During tool ENTER(Keys Action) and at the same time Login page direct to Main page and keyword test show error below

=>  Error "Unable to obtain the item's rectangle." show

 

 

Can anybody help?

6 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I understand the steps from 1 to 4, but I don't understand what step 5 is doing? Are you perform a carriage return ('Enter') into the password field?

    • ZairossH's avatar
      ZairossH
      New Contributor

      For the step 5 I call function below to execute and get status but still get error

       

      function txtPassword_KeyPress()
      {

         try
         {
             var frmLogin = frmLogin_Find();
             if (frmLogin == null)
                  return false;
             frmLogin["Keys"]([Enter]);
             return true;

         }

         catch (ex)
         {
             return false;
         }
      }

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Are you using C# as your language? I think the statement should read,

     frmLogin["Keys"]("[Enter]");

     as shown in Keys Actions.

     

    If you have entered username and password in Step 2, and then logged in via Step 3. What's the purpose of Step 5?

    • ZairossH's avatar
      ZairossH
      New Contributor

      i using C# language

      sorry, i'm copy missing "

      in my script it is 

      frmLogin["Keys"]("[Enter]");

        but some time still error like situation i already mentioned on top

       

      If you have entered username and password in Step 2, and then logged in via Step 3. What's the purpose of Step 5?

      - Because after page load success(at step 1) and I action step 2,3,4 but still can't login => That why I need to re-login by step 5

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Using valid credentials, why are you not able to login, in the first attempt?

     

    I'm just trying to understand the actions being performed.

    • ZairossH's avatar
      ZairossH
      New Contributor

      Login sometimes fails because the system does not return authen response that's why it needs to be repeated.

       

      Sorry, i was missing your message.