Tuesday, March 16, 2010

The challenge of automating dynamic web applications

Consider automating something like Search Results on a web page. As data changes, the order of items in the result list will likely change with it. This can pose a great challenge for your automation engineer in terms of creating robust and maintainable tests. It can cause your tests scripts to "think" they've found the right object, where in fact it is working with an impostor.

Pages like Search Results are becoming more and more common in modern web application. Elements on the page are dynamic and move around in unpredictable ways-- especially in applications that employ social networking or Web 2.0 types of functionality.

The area of test automation where you identify elements on the page is called OBJECT MAPPING.

One of the biggest differences between automated tools is how they handle object mapping. Some are "smarter" than others and can use multiple properties to narrow in on the correct object. But there is no magic bullet for the out-of-the-box solutions. The automation engineer will need to configure (or develop) his own solutions in order to successfully automate these types of pages.

If you have a cooperative development team, see if they are willing to assign static HTML IDs to your moving targets-- it can greatly simplify this task. Make your case to development as to how automation will benefit them.

Inevitably, there will be some pages where it falls on the automation engineer to come up with his own solution. The fail safe here is to make sure your automated tool can access the page source (the HTML), so that you can parse it and locate your object. As long as you can access the HTML, the control you are looking for is not out of reach. Know your regular expressions.

No comments:

Post a Comment