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.
© Copyright 2000-2008 by Software Research, Inc.

eValid -- UPS Rate Estimation with Motion Commands
eValid Home

Summary
This page presents an eValid solution to a publically posed problem that requires analyzing a website to extract rate information. The script involved:

  1. Navigates into the target website, a shipping company.
  2. Selects (from a parametric list of user-supplied values) an origin city and a destination city.
  3. Navigates to the rate calculation page.
  4. Saves the "Selected" text area containing the rate information for off-line analysis.

The eventual eValid script uses Data Synthesis to incorporate parametric data (origin/destination city pairs) so that the rate variations can be studied efficiently.

Problem Statement
Here is the original problem statement, as posted on comp.software-eng:

Script Development Process
To develop the time and cost calculation script and save the Time and Cost related data, we organized the script development process into multiple steps, described here in detail:

  1. Starting Page
    Navigate go to the http://www.ups.com webpage; this is where each playback will begin.
    Once there we can proceed to CALCULATE the available Time and Cost for sending a 1 lbs. UPS Letter.

  2. Choose Script Name
    Start the Recording, and choose the script filename, i.e. "ups"...

  3. Choose Location
    Choose the location, i.e. "United States - English"...

  4. Select Goal
    Select what you are looking for, in this case "Calculate Time and Cost"...

  5. Provide Shipment Information
    Provide the shipment details and then click on "Next"...

  6. Provide Shipping Details
    Provide the additional required shipment details and then click on "Next"...

  7. Results Displayed
    At this point in the playback you will see a page that provides the "Time and Cost Summary" for a variety of shipping options. This is the page that contains the results you want. (Later, we'll save the visible text contents of this page for post-run analysis).

  8. Selecting the "View Details" Link
    For more details, you can CLICK on the corresponding shipping option's icon/link for the "Time and Cost Detail". This is the page that only contains details for the selected service. (You can highlight and save selected text contents from this page for post-run analysis).

  9. End Recording
    Stop the script recording process and note that the script has been filed in the specified filename.

  10. Adjust Script to Save Data
    Now, make a manual edit of the script to include a "SaveSelectedText" command that will save all or some of the data on the target page for later analysis. At the same time, modify the script so that there are parameters for each of the values that will be substituted automatically. In this case the variables are $CITY, $ZIPCODE, and $OUTPUT (the name of the output file).

  11. Set Up Data Synthesis File
    We will be using the DataSynthesis feature to parameterize different input/output shipping cost iterations. To do this we need to set up a DataSynthesisFile called input.txt.

    We populate this file with 5 predetermined shipping locations so that, at script playback time, eValid will generate 5 associated service calculations. The information is passed to eValid as a set of $NAME/$VALUE pair substitutions.

    NOTE: Each $NAME=$VALUE pair is separated by a space and each iteration is denoted by a RETURN, also differentiate a character SPACE using %20, etc. Here is the contents of the Data Synthesis file [for five shipping destination variations]:

  12. Add DataSynthesisFile Details To Script
    Now, manually edit the .evs script file to include declaring the "DataSynthesisFile" to be used. This is the file which contains the $NAME=$VALUE fields.

    Before Editing...

    After Editing...

  13. Add Motion Commands to Arrive at Rate Value
    Now, make a manual edit of the script to include a set of internal index motion moves so that we can arrive at the desired "View Details" link. Knowing we are at the right place on the page, we replace the original "InputImageClick..." with a IndexFollowLink command.

  14. Choose eValid Settings
    Change your "eValid: Settings -> Record/Play Prefs -> Project/Log Management -> Log Output" settings to those appropriate for a DataSynthesis run. To generate an event log with all 5 iterations being played back, we need to make sure that "Append to Logs" is enabled, as shown here:

  15. Start Playback in Correct Mode
    To run the script in Data Synthesis mode, you need to make the selection "Playback->Control Playback->Run Synthesized", as shown here:

  16. Wait For Playback Completion
    When "Run Synthesized" has reached the end of playback -- having run the script one time for each line in the Data Synthesis file -- eValid will indicate completion, as shown here:

    OR, in case any eValid Adaptive Playback actions were needed to preserve the script integrity, you'll see this display:

  17. Confirm Output Files
    Play back completion will result in producing five output files, named according to the specification in the DataSynthesis file. They contain the data on the service available for each of the five input pairs. Here are the files:

  18. Examine Output Files
    Here is a sample of one of these output files:

  19. Completed Script
    Here is the eValid script that shows the results of the recording and script preparation process.
    CAUTION! You will probably have to modify the "shipDate" accordingly, as this page and/or environments may differ from the initial creation point!

    # AUTOPLAY8=8;ue-ju<r/
    # 
    # Recording by eValid(TM) V8 
    # Copyright © 2008 by Software Research, Inc. 
    # Recording made on: Microsoft Windows 2000 Service Pack 3
    # 
    
    ProjectID "Temp"
    GroupID "mysuite"
    TestID "ups"
    LogID "AUTO"
    
    ScreenSize 1280 1024
    FontSize 1
    DeleteCache
    DeleteCookies
    
    DataSynthesisFile "input.txt"
    
    InitLink "http://www.ups.com/"
    Wait 2648
    InputValue 0 59 "SELECT-ONE" "" "cookie" "United States - English" "1" ""
    Wait 1432
    InputImageClick 0 303 "http://www.ups.com/img/btn_arrow_large.gif" "Go" "" NAV
    Wait 2196
    InputValue 0 251 "SELECT-ONE" "" "dropdownList" "Calculate Time and Cost" "" \
    	"19" "" NAV
    Wait 2186
    InputValue 0 811 "TEXT" "" "origCity" "San Francisco" "" ""
    TabKey 0
    Wait 2225
    InputValue 0 817 "TEXT" "" "origPostal" "94103" "" ""
    Wait 2898
    
    #  Originally recorded value...
    #InputValue 0 827 "TEXT" "" "destCity" "Los Angeles" "" ""
    #  Manually edited parameterization value using DataSynthesisFile...
    InputValue 0 827 "TEXT" "" "destCity" "$CITY" "" ""
    
    Wait 2063
    
    #  Originally recorded value...
    #InputValue 0 833 "TEXT" "" "destPostal" "90024" "" ""
    #  Manually edited parameterization value using DataSynthesisFile...
    InputValue 0 833 "TEXT" "" "destPostal" "$ZIPCODE" "" ""
    
    Wait 2418
    InputValue 0 902 "SELECT-ONE" "" "shipDate" "Tuesday, May 8, 2007 " "57" ""
    Wait 2489
    InputValue 0 1007 "TEXT" "" "weight" "1" "" ""
    Wait 2343
    InputValue 0 1051 "CHECKBOX" "" "document" "02" "TRUE" ""
    Wait 2844
    InputValue 0 1080 "RADIO" "" "quoteType" "estimateTimeCost.x" "TRUE" ""
    Wait 2604
    InputImageClick 0 1095 "http://wwwapps.ups.com/img/en/btn_next_a.gif" "Next" "" NAV
    Wait 6289
    InputValue 0 359 "RADIO" "" "dropOffChoice1" "CC" "TRUE" ""
    Wait 6048
    InputValue 0 448 "SELECT-ONE" "" "container" "UPS Letter" "2" ""
    Wait 3135
    InputImageClick 0 522 "http://wwwapps.ups.com/img/en/btn_next_a.gif" "Next" "" NAV
    Wait 2102
    
    # Manually added playback motion commands to perform web page selection.
    IndexSet 0
    IndexFindElement 0 DOWN "nameProp" "next_day.html')" ""
    IndexMove 13
    IndexFollowLink 0 ""
    
    #  Adding synchronization(s) assure arrival at the designated 
    #  calculation webpage... 
    SyncOnText 0 "Guarantees and Notices" ""   
    SyncOnURL "http://wwwapps.ups.com/ctc/summaryTimeCost"
    
    
    Wait 2113
    
    # Selective data save of item that conatins the computed rate data...
    SaveSelectedText 0 "$OUTPUT" 412 0 226 ""
    
    Wait 3000