Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium - verify the list of suggestions is displayed

Tags:

selenium-ide

What command is used to verify the list of suggestions is displayed when typing a letter in text field (example: a)? And how to verify the items in the list start with the letter you typed?

like image 218
Ana Avatar asked Feb 02 '26 14:02

Ana


1 Answers

I believe you're talking about something like Google Suggests with autocomplete. Your test would look something like this

  1. Load the page
  2. Enter the value using typeAndWait to let the Ajax call happen
  3. Compare the result to a text blob

The calls would be like this

open(/)
typeAndWait(textId,a)
verifyText(css=div#suggestion:first-child,a*)

Hope that helps

like image 103
pnewhook Avatar answered Feb 05 '26 07:02

pnewhook



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!