Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Please brief me about the Ajax testing with selenium RC. As in Ajax element does not reflect on the view-source, but using firebug we can see the changes in HTML source code.

There are two methods associated with it..

1-The method "waitForCondition (java.lang.String script, java.lang.String timeout), to provide script we have to create a java script by own or it should be the same Ajax script/java script present on the web page.

Please correct me if i am wrong on below point..

2-The method "waitForElemantPresent(Locator)", We check the Element in the firebug and check the same in this method is self waitForElemantPresent(Locator).

Let me know if anything else I am missing testing Ajax application.

share|improve this question
Well if you answered your question and have got it right too :) – Tarun Jun 28 '11 at 18:41
Hey @Tarun I still need the answer of the first point...:) Thanks a lot again – smriti Jun 29 '11 at 9:41
up vote 2 down vote accepted

I already gave an example on a similar question which can be used to wait for Ajax and javascripts to finish.

Here it is:

        "selenium.browserbot.getCurrentWindow() == 0",


share|improve this answer
Only works if you are using jQuery, won't work for all AJAX sites. – Ardesco Jun 30 '11 at 11:08
Thanks a lot Hannibal and Ardesco for this great help. I got this form one article JQuery: “” Prototype: “Ajax.activeRequestCount” Dojo: “” So if there is Ajax call we can use second option. Please correct me if I am missing something …. Thanks in Advance – smriti Jun 30 '11 at 12:33
True. But you can easily attune it to something else. :) Glad it helped smriti! :) – Hannibal Jun 30 '11 at 12:33

You could you wait for condition like this -

selenium.waitForCondition("selenium.isElementPresent(\"element locator\")", "waitPeriod")

Hence you need to write the wait condition and here in I have used one of the Selenium API it self

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.