Using object in auto-complete drop down list
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Have you tried to use .Keys() instead of .SetText() as it was suggested by @mattb ?
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using Keys is unfortunately not working.
I had my test click on the textbox, enter a value, press down and the enter but when replaying it does not actually select the item.
I can do this manually on the app but seemingly not through TC.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!
Using a combination of Keys() and Delays I was able to get this to work.
