1

enter image description here

After input in company name field, from auto-suggest list I want to select last value in QTP 12.51.

Please see attached image and waiting for reply.

2

So to select value from Autosuggest list, first you need to make sure atleast the value which you want to select or the position of that element in the list. Than you can click on that perticular item by either taking the text validating it with the desired input or we can directly click on the 4th position element.

Also for the same case if it all you are stuck, try using record and playback, you will get the approach of handling such cases.

Thank you! Hope it was helpful!

1

It is hard to help you with an exact answer as you have not provided web elements for this auto-generated web element list.

As a general rule:

companyNameInputBox = driver.find_element_by_css_selector("the css selector of this text input box").send_keys("T.A. ACTON")
listOfAutoMatches = driver.find_elements_by_css_selector("ul>li")

listOfAutoMatches will have all four auto generated names, where you can address the last one by using listOfAutoMatches[3].

You may not be able to copy and paste my answer as I might have used an incompleted css selector based on the limited info. you provided.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.