Ajax testing with Selenium using waitForCondition

Posted in Project Management, Testing, Web Technologies, Development on January 17, 2007

Ajax testing with Selenium using waitForCondition

An often-asked question on the selenium-users mailing list is how to test Ajax-specific functionality with Selenium. The problem with Ajax testing is that the HTML page under test is modified asynchronously, so a plain Selenium assert or verify command might very well fail because the element being tested has not been created yet by the Ajax call. A quick-and-dirty solution is to put a pause command before the assert, but this is error-prone, since the pause might be not sufficient on a slow machine, while being unnecessarily slow on a faster one.

A better solution is to use Dan Fabulich's waitForCondition extension. This tiny screencast is a short demo for interesting article about using waitForCondition extension for Selenium to test AJAX applications. So, please read this article first and then - watch short demonstration.

Watch Video Watch Video on External Site

Tags: Debugging, Practices, Q&A, Testing, Technologies, AJAX, Javascript, Demo