开发者

Selenium - verify the list of suggestions is displayed

开发者 https://www.devze.com 2023-01-15 07:03 出处:网络
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 l开发者_StackOverflow社区ett

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 l开发者_StackOverflow社区etter you typed?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消