Your e-Business Quality Partner eValid™ -- The Web Quality Suite
Browser-Based, Client-Side, Functional Testing & Validation, Load & Performance Tuning, Page Timing, Website Analysis, and Rich Internet Application Monitoring.

eValid -- Structural Testing With DOM Commands -- Navigation to URL Example
eValid Home

Background
The eValid DOM index/motion algorithmic/structural testing capability makes it possible to produce robust tests which behave independently of page specifics.

Use of the DOM Manipulation Resources leads to tests that are able to operate at a level of abstraction above that of the usual eValid command level. This example is one of a series that illustrate how this process works. Please see the Guide To Examples for the complete set.

Description of Tested Feature
This example navigates to an active link that points to a specific URL. The passage may be different if the navigation is performed via a JavaScript passage.

Index/Motion Command Sequence
Here is the command sequence that achieves the desired result:

...
IndexSet start_value
IndexFindElement wid DOWN "attribute_name" "attribute_value" "frame_path"
IndexFollowLink wid "frame_path" 
...

eValid Script
Here is the eValid script that is an actual instance of this action.

# Recording by eValid V9 
# Recording made on: Microsoft Windows XP Service Pack 3 (IE 7.0.5730.13)

ProjectID "Project"
GroupID "Test"
TestID "example01"
LogID "AUTO"

DeleteCache
DeleteCookies

InitLink "about:blank"

GotoLink 0 "http://www.google.com" ""
Wait 1000

# Recorded command...
#------------------------------------------------------------------------
FollowLink 0 31 "Images" "http://www.google.com/imghp?hl=wn&tab=wi" ""
#------------------------------------------------------------------------


GotoLink 0 "http://www.google.com" ""
Wait 1000

# Structural command equivalent...
#------------------------------------------------------------------------
IndexSet 0
IndexFindElement 0 DOWN "tagName" "A" ""
IndexFollowLink 0 ""
#------------------------------------------------------------------------

# End of script.

Download example01.evs

How It Works
The script finds the first-occuring anchor tag on the page, starting at the top, and follows it. Or, eValid goes to the link referenced on the innerText URL, e.g. Images.