views:

23

answers:

1

Hi there,

Does anyone know how to do waitForAjaxRequest using seleniumRc(like waitForPageToLoad) on tapestry zone? I know there are alternatives like wait for certain element to appear and etc.

I am seeking for a proper waitForAjaxRequest, and wish it work on different browsers as well.

I had tried browserbot, but no luck. :-(

Thanks.

A: 

You can use waitForCondition:

selenium.waitForCondition("script", "timeout")

while timeout is in milliseconds (e.g. 30000) and the script is JavaScript that has to return true when the condition is fulfilled, e.g.

"var value = selenium.getText("foo"); value.match(/bar/);"

(See OpenQA Wiki for more information. Even though this links to a plugin that was in use with an older version of Selenium, waitForCondition is now part of SeleniumRC.)

Jan