|
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 then fills-in and submits the form.
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 result:
... IndexSet 0 IndexFindElement wid DOWN "name" "value" "" IndexInputValue wid "TEXT" "Text-To-Be-Entered" "" "" IndexMove +1 IndexFindElement wid DOWN "name" "value" "" IndexInputValue wid "TEXT" "Text-To-Be-Entered" "" "" ...
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 "example06" LogID "AUTO" InitLink "http://www.quirksmode.org/js/formex.html" Wait 1250 # Recorded command... #------------------------------------------------------------------------ InputValue 0 61 "TEXT" "" "name" "John Doe" "" "" Wait 1237 InputValue 0 65 "TEXT" "" "address" "123 Apple Avenue" "" "" Wait 5711 InputValue 0 69 "TEXT" "" "City" "Dallas" "" "" Wait 4266 InputValue 0 73 "TEXT" "" "E-mail" "a@b.com" "" "" Wait 3856 #------------------------------------------------------------------------ InitLink "http://www.quirksmode.org/js/formex.html" Wait 1250 # Structural command equivalent... #------------------------------------------------------------------------ IndexSet 0 IndexFindElement 0 DOWN "name" "name" "" IndexInputValue 0 "TEXT" "John Doe" "" "" IndexMove +1 IndexFindElement 0 DOWN "name" "address" "" IndexInputValue 0 "TEXT" "123 Apple Avenue" "" "" IndexMove +1 IndexFindElement 0 DOWN "name" "City" "" IndexInputValue 0 "TEXT" "Dallas" "" "" IndexMove +1 IndexFindElement 0 DOWN "name" "E-mail" "" IndexInputValue 0 "TEXT" "a@b.com" "" "" #------------------------------------------------------------------------ Wait 5208 SubmitClick 0 105 "" "" "Submit form" "" NO_NAV # End of script.
Download example06.evs
How It Works
Here the example passage inputs a complete name/address/city/email into the FORM's text area and then clicks "Submit form" button.