Has anyone a good solution on how to test auto-complete combo box in Selenium?
Thanks for the help,
Manjide
Has anyone a good solution on how to test auto-complete combo box in Selenium?
Thanks for the help,
Manjide
Take a look at my other answer http://stackoverflow.com/questions/3640677/selenium-verify-the-list-of-suggestions-is-displayed
Using TestPlan with the Selenium back-end this code grabs the suggestions from Google -- which is an example of a auto-complete combo box.
GotoURL http://www.google.com/webhp?hl=en
ClickReplaceType //input[@name='q'] what is my
# This is where the suggestions appear
set %ResultsXPath% //table[@class='gac_m']//td[@class='gac_c']
# Check that they are there (that is, wiat for them, since they are dynamic)
Check %ResultsXPath%
# Then iterate over the suggestions
foreach %Cell% in (response %ResultsXPath%)
Notice %Cell%
end
This produces the results:
00000000-00 GOTOURL http://www.google.com/webhp?hl=en
00000001-00 NOTICE Starting a new browser (0:0:0:0:1) com.thoughtworks.selenium.DefaultSelenium@332611a7
00000002-00 NOTICE what is my ip
00000003-00 NOTICE what is my ip address
00000004-00 NOTICE what is my bmi
00000005-00 NOTICE what is my house worth
00000006-00 NOTICE what is my
Usually such tests work in both the Selenium and HTMLUnit backend in TestPlan, but Google currently works with Selenium.