Forum Discussion

nastester's avatar
Regular Contributor
3 years ago

Using object in auto-complete drop down list

The web application I am testing has a textbox that autocompletes when you start typing in it. 

In my test, I want to SetText in that textbox and then select the one item it populates. I can map this object but during the test it is not selecting the item from the list. In fact, I don't see the list displaying at all after some values are typed in the box.

What can I do? 

Thank you

  • Hi,


    but seemingly not through TC.

    As this is web application, what you need is doable with 99% probability.

    Generic sequence of actions (that may vary depending on how the given control has been implemented):

    -- Set focus to / click the control and start typing using .Keys() method;

    -- Delay script execution until the drop-down window appears after some part of the text has been typed;

    -- Investigate the drop-down window in the Object Browser / Object Spy to find out how to identify this window in test code and how to get a list of its elements;

    -- Using the results of the above investigation, write a code that, after some portion of text has been typed, will wait for the drop-down window, search for the required element in it and click on the found element.



6 Replies

  • Hello,

    Maybe after you settext, click on the textbox again and see if it will display the autocomplete menu. I would also recommend before selecting the actual item in the autocomplete menu to add a small delay (500 ms max)

    Is the method Keys available also? Maybe that would work better for the autocomplete to generate. 

    • nastester's avatar
      Regular Contributor

      This is not working unfortunately. When I run the test, the autocomplete drop down list is not showing so TC can't find the object to click on it.