I´m using the Selenium IDE for Firefox and searching for a wait command. My problem is that I want to test a website with a embedded external map. This external map needs 3-5 seconds to load.
My commands:
open /Page/mysite.html
//Wait Command? (5 seconds)
ClickAndWait link=do something
The pause command can be used directly in the ide in the html format.
If using java or C you could use Thread.sleep(5000). Time is in milliseconds. Other languages support "sleep 5" or time.sleep(5). you have multiple options for just waiting for a set time.
This will delay things for 5 seconds:
Command: pause
Target: 5000
Value:
This will delay things for 3 seconds:
Command: pause
Target: 3000
Value:
Documentation:
http://release.seleniumhq.org/selenium-core/1.0/reference.html#pause
This will wait until your link has appeared, and then you can click it.
Command: waitForElementPresent Target: link=do something Value:
Your best bet is probably
waitForCondition
and writing a javascript function that returns true when the map is loaded.One that I've found works for the site I test is this one:
waitForCondition | selenium.browserbot.getUserWindow().$.active==0 | 20000
Klendathu
This will do what you are looking for in C# (WebDriver/Selenium 2.0)
And never use Thread.Sleep because it makes your tests unreliable