Monday, November 28th, 2005

Using Selenium to test asynchronous calls

Category: JavaScript, Testing, Toolkit

<p>Joseph Moore recently wrote about how his team is working with Selenium to test their ajax apps. Most of the normal Selenium actions weren’t working well for the ajax calls, as they are expecting synchronous communication.

So Joseph used the “waitForValue” and “waitForCondition” features, which can just sit and watch for the DOM or input values to change after the async call was made. He says:

Why the Selenium folks don’t have bright red “hey, use this for your Ajax testing!” flag on these two items is beyond me.

Right now it seems there are so many different approaches to testing Ajax that developers aren’t sure where to start. There isn’t a clear cut framework or approach that has the dominance of the xUnit approach for the server side code.

Further resources to muddy the waters =) :

Related Content:

Posted by Rob Sanheim at 12:39 am
3 Comments

++++-
4 rating from 12 votes

3 Comments »

Comments feed

I have also created a test framework for flash based applications. http://tiago.webstartpoint.net/flash

The good thing about this functional testing frameworks is that if they provide recorders they make tests a lot easier to create.

Because they also only test the functional part of the application they live better throught all the refactorings that you might want to do.

Developers should only be allowed to interact with their applications in two modes:
- recorder mode
- playback mode

This would make development faster and safer.

Comment by Tiago Simoes — November 28, 2005

Thanks for the other testing links.

We’re thinking about adding a hidden “ajax done” element in the DOM to make testing using waitForValue a bit easier. I’ll keep you posted.

Comment by Joe — December 4, 2005

“Why the Selenium folks don’t have bright red “hey, use this for your Ajax testing!” flag on these two items is beyond me.”

It is listed here now -

http://seleniumhq.org/docs/05_selenium_rc.html#how-can-i-wait-for-an-element-in-ajax-driven-application

Comment by tarun3kumar — July 13, 2009

Leave a comment

You must be logged in to post a comment.