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 -- Find A Dynamic Tag And Click It
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 a GMAIL account, signs in, clicks on the "Compose mail" link, and signs out.

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

...
IndexSet 0 
IndexFindElement wid DOWN "innerText" "Something" "" 
IndexFindElement wid DOWN "tagName" "DIV" "" 
IndexElementMouseDown 0 "frame"
IndexFollowLink 0 "frame"
...

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

# Recording by eValid V9 
# Copyright 2000-2012 by Software Research, Inc. 
# Recording made on: Microsoft Windows Vista Service Pack 1 (IE 7.0.6001.18000)

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

InitLink "http://www.gmail.com/"
Wait 2032
InputValue 0 99 "TEXT" "Email" "Email" "evalidinc" "" ""
ElementFocus 0 108 "Passwd" "" ""
Wait 5148
InputValue 0 108 "TEXT" "Passwd" "Passwd" "p㮉" "" ""
Wait 5647
SubmitClick 0 121 "" "signIn" "Sign in" "" NAV
# DOM synchronization commands are here...
SyncNotOnElementProperty 0 "innerText" "Loading evalidinc@gmail.com..." ""
SyncOnText 0 "evalidinc@gmail.com" "number:3"

# Recorded command...
#------------------------------------------------------------------------
Wait 3573
ElementDblClick 0 224 39 7 "" "Compose mail" "number:3"
Wait 3268
WindowPos 0 0 0 980 696
clLClick 0 55 192
#------------------------------------------------------------------------
Wait 6000
FollowLink 0 97 "evalidinc@gmail.com" "https://google.com/profiles" "number:3"  
Wait 2422
FollowLink 0 121 "Sign out" "https://mail.google.com/mail/?logout&hl=en" "number:3"  
Wait 1563


InitLink "http://www.gmail.com/"
Wait 2032
InputValue 0 99 "TEXT" "Email" "Email" "evalidinc" "" ""
ElementFocus 0 108 "Passwd" "" ""
Wait 5148
InputValue 0 108 "TEXT" "Passwd" "Passwd" "p㮉" "" ""
Wait 5647
SubmitClick 0 121 "" "signIn" "Sign in" "" NAV
# DOM synchronization commands are here...
SyncNotOnElementProperty 0 "innerText" "Loading evalidinc@gmail.com..." ""
SyncOnText 0 "evalidinc@gmail.com" "number:3"
SyncOnElementProperty 0 "innerText" "Oldest " "number:3"

# Structural command equivalent...
#------------------------------------------------------------------------
IndexSet 0
IndexFindElement 0 DOWN "innerText" "Compose mail" "number:3"
IndexFindElement 0 DOWN "tagName" "DIV" "number:3"
IndexElementMouseDown 0 "number:3"
IndexFollowLink 0 "number:3"
#------------------------------------------------------------------------
Wait 6000
FollowLink 0 97 "evalidinc@gmail.com" "https://google.com/profiles" "number:3"  
Wait 2422
FollowLink 0 121 "Sign out" "https://mail.google.com/mail/?logout&hl=en" "number:3"  
Wait 1563

# End of script.

Download example12.evs

How It Works
This is a very short example. The GWT environment is known for its rather tricky and dynamic Asynchronous behavior.

Please note that the "Sign out" process used by this application will differ depending on your OS and IE versions. The above script assumes that "Sign out" is under the evalidinc@gmail.com drop-down menu layer. Your OS/Gmail product version combination may differ, and the script will need to be adjusted accordingly.