Your e-Business Quality Partner eValid™ -- The Web Quality Suite
Browser-Based Client-Side Functional Testing and Validation Page Timing/Tuning Transaction Monitoring. WebSite Spidering & Analysis and Realistic Server Loading.

eValid -- Value Setting Loop -- General Description
eValid Home

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:

  1. Extraction of value from a page
  2. Saving the extracted value to a file
  3. Inserting the saved value into a new script
  4. Invoking the new script which contains the inserted value

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

  1. Initial Link
    The script starts with this page taken from the W3schools.com website. Our objective is to extract a session id number for a user from the value stored in the page, so we chose a page that demonstrates use of session id values.

  2. Generating The Value
    After arriving at the required page, we click on the option to "Return a session id number for a user" on the original example page. You can see that the session value shows on the sub-screen, as 246550336.

    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).

  3. Extracting The Value And Saving It Locally
    Now we know that the value we want is on the page, but we now have to find out specifically where it is so we can extract it.

    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

  4. Using The Value In An Environment Variables File
    To use the value, the newly created "ssid.txt" file is called that reads the above-created information into the post-extraction playback sequence. Now the script includes the parameter $idVALUE that is the one we just created, and to which we have now assigned a value that will be read later on in the playback sequence.

  5. Confirming the Session ID Transfer
    As the main screen here shows, the 246550336 session ID appears as required in the ?session=246550336 parameter of the Address field in the browser (at top of screen).

    Note: This screenshot is not necessarily your intended playback results; it is included for its instructional value.

  6. Calling The putsession.evs Script
    The environment for the putsession.evs script is ready, and as this screenshot shows, the last step in the main getsession.evs script is to call the putsession.evs script. That script uses the value we extracted earlier. At this point the "loop" is complete.

    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: