|
Overview
This page describes facilities in eValid that allow intra-session
and between-session manipulation of element values extracted from web pages.
Introduction
The basic idea of structural testing is to permit manipulation of the
internal details of a web page.
This usually means extracting a value from one place and putting it back
in another place.
This example illustrates key commands from the available Structural Testing Resources. The basic elements of the example involve:
We call this a "value setting loop" because each trip around the cycle updates one value. Of course, it is equally possible to update multiple values in each cycle, but for illustration purposes we will show only one example.
Example Explanation
The figures below illustrate the script that was used with the web page
from which the target value was extracted.
In all steps below when you click on the thumbnail image it will open in a new window so you can see the details of the script and the page
To make this scipt independent of position within the page, we converted the original FollowLink command into a structural sequence that always follows the specified link. The originally recorded commands are commented out (we do that to remind us later where the command came from).
That's the purpose of the next sequence of commands, which first identify the location of result_output. The IndexFindElement command finds that index, and because we know that the required tagName will be below that location, we use a second IndexFindElement to set the eValid-internal sourceIndex value to that location.
Finally there is a ValueGetElement command to obtain the text of the value we saw above. The eValid-internal variable elementValue now contains 246550336.
The last piece of work is to put that number into an external value, here called idnumber.txt, which is followed by creation of a short file name.txt. These two strings are composed into a new command by an external batch file, so that the environment variables file "ssid.txt" will have at least one line in it that says: $idVALUE=246550336
Note: This screenshot is not necessarily your intended playback results; it is included for its instructional value.
Note that the playback shows a red screen because the example is intended to show the extraction and insertion, so this script would not be expected to play back without an actual website.
Resources
Here are the scripts used in the above examples: