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