Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use selenium.waitForCondition to detect end of AJAX call

734409May 20 2010 — edited Aug 17 2010
We started using Selenium and one thing that would be desirable is if for each AJAX call, we could have a generic wait condition i.e. we don't want to wait for a particular element to show up. That's not even going to work in all cases. If you're using an af:iterator or af:forEach, you would want to wait till the last element is done and you won't know what that is unless you hard code that particular ID. Anyway, it's just bad to do something like that and not always feasible.

I found one way that's supposed to work. I haven't seen anyone mention it not working.
        selenium.waitForCondition("selenium.browserbot.getCurrentWindow().Ajax.activeRequestCount == 0", "10000");
Here's the blog where I found it.
http://blog.vishnuiyengar.com/2009/08/testing-ajax-applications-with-selenium.html

However I get this error:

>
com.thoughtworks.selenium.SeleniumException: selenium.browserbot.getCurrentWindow().Ajax is undefined
>

I don't know what's supposed to create the Ajax object. I take it that ADF doesn't. Does anyone know of an equivalent way to tell that there are no active Ajax calls being processed?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 13 2010
Added on May 20 2010
3 comments
2,722 views