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

eValid -- Random Search Confirmation Example
eValid Home

Problem Description
This example combines several evalid functions to provide a script that checks out the results from a search engine, using a "fuzz test" approach.

The example here involves these key steps:

  1. At test playback time generate a random search string composed of draws from a number of word lists.
  2. Save the actual search-string generated for later confirmation in the results page.
  3. Run the search (e.g. on Google) and generate a search result pages.
  4. Make sure that the result page includes [at least one] instance of the randomly sought value.

Example Passages
Here is a step by step illustration of how this was done using eValid components.

  1. Generate The Random Email Address
    The script passage that accomplishes this is an invocation of the eV.Generate component like the following:

    # eValid Script File contents...
    ...
    Lock
    Delay 250
    eVgenRand "script.evt" "table.data" N
    ...

    This command applies the eV.Generate random sequence generation process to the script.evt file, using the data in the table.data file, to produce the script.evs file. eValid then repeats this process N times (e.g. N = 10).

    The Lock command gives this instance of eValid exclusive access to the machine, and the assumption is that the first line of the script.evt file will have the following:

    # eValid Script Template contents...
    ...
    UnLock
    ...

    This assures that the eV.Generate process will run exclusively on the machine. The 250 msec delay (Delay 250) is included to allow the machine sufficient time to engage the Lock which will be disengaged when the script generation is completed and starts to run.

  2. Specify the Random Email Account Name
    Here is how you specify the random four character email account name in the script.evt file:

    # eValid Template file "script.evt" contents...
    ...
    InputValue 0 123 "" "emailin" "{% let}{% let}{% let}{% let}@domain.com" "name:frame"
    ...

    Here the values that are chosen at random for the {% let} strings by eV.Generate are drawn from the value table that contains a line that looks like the following:

    # eValid Value Table contents...
    ...
    let a b c d e f g h i j k l m n o p q r s t u v w x y z
    ...

  3. Confirm The Generated Email
    The generated email has to be confirmed, and the way to do this is to extract the just-generated value from the page and insert it in the "Retype Your Email" input.

    The extraction is done this way:

    # eValid Template file "script.evt"
    ...
    IndexSet 0
    IndexFindElement 0 DOWN "name" "emailin" "name:frame"
    ValueGetElement 0 "Value" "name:frame"
    ...

    The earlier-generated email string value is now stored in elementValue.

    # eValid Template file "script.evt"
    ...
    IndexSet 0
    IndexFindElement 0 DOWN "name" "emailconfirm" "name:frame"
    ValuePutElement 0 "Value" "name:frame"
    ...

    This puts the same email value that was previously put into the emailin field also into the emailconfirm field.