Forum Discussion

enriquebravo's avatar
enriquebravo
Contributor
2 years ago

Inconsistent Keys Method Behavior

Hi,

The keys method used in dropdown and textbox fields does not work properly. When invoked, the focus is shifted from the field to the browser window tab strip and when I try to bring the focus back on the field, the list of values is lost or the text is not entered in the field.

Not sure if this is a tool or a browser problem, but apparently there were no updates that could bring in this problem. It worked fine a week ago, even before the new TestComplete version was launched. I updated TestComplete, expecting the problem to go away but it is not the case.

 

I am also getting a weird Member Not Found error if I try to spy during playback to debug.

 

Attached, two videos showing the issue.

Thanks.

 

  • Hey everyone. Thanks for the replies. The control does not have a ClickItem method and when I recorded and played the script back it failed. I added a breakpoint to try and spy the object, but I got the "Member not found" error.

     

    The good news is that I got it to work. Here is what I did, For the dropdown, I was able to click on it to display the list of values, then, instead of sending the keys action to the dropdown, I sent them to the parent element, in the case the page.

     

    The textbox could be solved in a similar fashion I guess, but it was just easier to log out, close the browser and then log in again with the next user.

     

    Have a good one.

  • Did you try recording a test that includes these steps and playing it back? Did that work?

     

    You should be able to find the actual drop down values by using ObjectSpy and then you can select them directly rather than trying to click on each of them.  

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I also have a similar UI control,

    HTML code,

     

    When you click the button, the drop down list is shown. In my instance, the HTML code shows that these are two different UI objects. Therefore, I have a name mapping for the button and the drop down list. You should then be able to use ClickItem() method, to select the item you want.

     

  • Hey everyone. Thanks for the replies. The control does not have a ClickItem method and when I recorded and played the script back it failed. I added a breakpoint to try and spy the object, but I got the "Member not found" error.

     

    The good news is that I got it to work. Here is what I did, For the dropdown, I was able to click on it to display the list of values, then, instead of sending the keys action to the dropdown, I sent them to the parent element, in the case the page.

     

    The textbox could be solved in a similar fashion I guess, but it was just easier to log out, close the browser and then log in again with the next user.

     

    Have a good one.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    ClickItem would most have likely worked, if you name mapped the bottom part of the UI control,

     

    • enriquebravo's avatar
      enriquebravo
      Contributor

      I will keep it in mind next time something similar occurs. 

       

      I appreciate the note. Best.