Ask a Question

Inconsistent Keys Method Behavior

SOLVED
enriquebravo
Contributor

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.

enriquebravo_0-1675102985660.png

 

Attached, two videos showing the issue.

Thanks.

 

5 REPLIES 5
Marsha_R
Champion Level 2

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
Champion Level 2

I also have a similar UI control,

rraghvani_0-1675159494623.png

HTML code,

rraghvani_1-1675159559689.png

 

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.

 

enriquebravo
Contributor

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
Champion Level 2

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

rraghvani_0-1675264222357.png

 

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

 

I appreciate the note. Best.

cancel
Showing results for 
Search instead for 
Did you mean: