Forum Discussion

nastester's avatar
nastester
Regular Contributor
4 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 thi...
  • AlexKaras's avatar
    AlexKaras
    4 years ago

    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.