Let's imagine you have an application that has a select
that is populated by AJAX. This is quite common for web applications that have select
, which is populated by values within the database.
Open the Selenium IDE.
Navigate to http://book.theautomatedtester.co.uk/chapter4.
Create a step for
waitForCondition
to wait till theselect
is populated. There is anoptions
property on the select that you can check the length of to see if it has loaded.Run your script. It should look similar to the next screenshot.
We just saw a command that had a look at the DOM. It then waited until a new item was loaded into the page. The waitForCondition
command runs outside of Selenium. This is why in the previous example we explicitly called selenium
instead of calling the parent with the this
object.