Friday, April 23, 2010

Reliable AJAX Recordings

Many users ask "How do we create tests of AJAX pages that are self-synchronizing?" It turns out that there is a very Simple AJAX Synchronization Methodology that records an AJAX application that stays in sync -- and the recording is direct from the eValid GUI "from life". The idea that grew from our experience in test development is to record a SyncOnText command after every action you take on the web application.

You do this by highlighting some text phrase on the page that MIGHT be subject to AJAX de-synchronization, and then clicking the eValid: Record > Validate > Selected Text pulldown from the GUI. The effect of this shows up in the Script Window as a SyncOnText command that explicitly mentions the text you had highlighted.

At playback time, when the eValid engine processes the SyncOnText command and then waits until that specific text shows up on the screen. It does this by interrogating the DOM for the current page, and if the DOM is not yet complete (the page has not fully downloaded) it will continue to wait until it DOES validate that phrase.

In the rare case when this simple method doesn't work you'll find that eValid has a full lexicon of SyncOnXXXX type commands, and these include some very sophisticated check loops based on specific values of page properties.

No comments: