Zombies Zombies - 1 year ago 166
Ajax Question

How to get selenium to wait for ajax response?

How can I get selenium to wait for something like a calendar widget to load? Right now I am just doing a

Thread.sleep(2500)
after exporting the testcase to a junit program.

Answer Source

I would use

waitForElementPresent(locator)

This will wait until the element is present in the DOM.

If you need to check the element is visible, you may be better using

waitForElementHeight(locator)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download