JavaScript Menu

How to apply eValid to functional testing of web applications.

JavaScript Menu

Postby ishere » Thu May 06, 2010 3:07 pm

In order to be able to run a test effectively, I have to be able to tell if a menu on the page is expanded or not. Unfortunately, it is a simple list of hyperlinks with javascript on the top link to expand or collapse the menu. However, the menu state is saved when the user logs out. I may be able to keep it open for the test run but in case it isn't, I want to be able to check in the test to see if it is.
ishere
 
Posts: 1
Joined: Thu May 06, 2010 2:51 pm

Re: JavaScript Menu

Postby eValid » Mon May 17, 2010 8:50 am

ishere wrote:In order to be able to run a test effectively, I have to be able to tell if a menu on the page is expanded or not. Unfortunately, it is a simple list of hyperlinks with javascript on the top link to expand or collapse the menu. However, the menu state is saved when the user logs out. I may be able to keep it open for the test run but in case it isn't, I want to be able to check in the test to see if it is.

This is a common situation when building a test to drive a complex JavaScript (nee AJAX) supported list.

The problem is, the current state of the page changes based on the activity of the JavaScript. The solution is to build the test with synchronizations to assure that the JavaScript has arrived at the right state.

The first thing to do is to use the PageMap to find out about the structure of that list of hyperlinks. You should be looking at the page as it is finally constructed, and you should be trying to identify a DOM element property name, like ID, that is unique to that particular list.

Then, once you have this identified, you set up a SyncOnSelectedObjProperty command aimed at that particular DOM element property.

At test playback time this command will wait -- rechecking periodically -- to see when that particular property takes on the value you specify. This will make for a very reliable, robust, and efficient test.

-eValid Support
eValid
 
Posts: 2396
Joined: Tue Jan 01, 2008 12:48 pm
Location: USA


Return to Desktop and Mobile Device Functional Testing

Design Downloaded from free phpBB templates | free website templates | Free Web Buttons