Selenium - check if a list of offers is displayed

Which command is used to check the list of offers that is displayed when a letter is entered in a text field (example: a)? And how to check that the items in the list begin with the letter you typed?

+3
source share
1 answer

I suppose you're talking about something like Google offers autocomplete. Your test will look something like this.

  • Download page
  • Enter a value using typeAndWait so that the Ajax event occurs.
  • Compare the result with a block of text

The call will be like this:

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

Hope that helps

+3
source

Source: https://habr.com/ru/post/1763195/


All Articles