|
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 -- Backbase/Duke's Bookstore Example & Demonstration Script
eValid Home
Summary
This page presents eValid's solution to functional testing, validating,
and loadtesting an AJAX application.
This solution illustrates:
- eValid's ability to synchronize test AJAX playbacks based on DOM content.
- eValid's ability to take actions on an AJAX application independent of dynamic page properties.
- eValid's ability to run multiple instances of AJAX tests in parallel.
Description
The example used is a demo developed with the
Backbase
AJAX-based web application development system.
The
Duke's Bookstore is one of their prepared demos of
the use of their AJAX development environment.
The main points of the example are:
- The functional test script involves use of
several of eValid's
SyncOnSelectedObjProperty command to synchronize
the AJAX portions of the page loading.
These commands are part of the
Playback Synchronization on DOM Element commands.
- The functional test script involves use of
eValid's
DOM Element Manipulation/Motion commands to
identify a button to push on a navigated-to page
independent of page details.
- The test script includes a
ValidateSelectedObjProperty command to confirm that the
navigations were successful.
- Playback of the test script is reliable without
any reliance on waits for synchronization.
- The measured download times
(using eValid's ElapsedTime command) show significant
variation over time due to the instantaneous load on the
associated server, as expected.
- The script is "desktop safe," meaning that
it could be run minimized if that were needed.
Such scripts do not need additional Lock/Unlock mutex operators
to run successfully in a multi-browser server loading test.
-
In server loading mode the relatively low overhead of eValid
assures that the total runtime of the playbacks are not perterbed
by any "measurement error."
Script Creation and Editing Explanation
Here is a description of how the script below was created.
- The script was first recorded with Real Time Recording on.
At initial playback, using the natural timings, the script produced
a green screen.
Using natural timing for synchronization may work incidentally, but
is not reliable in general.
- We removed the Wait commands and re-ran the script, which
as expected without additional synchronizations, produced a red screen.
- Using the information from the red screen playback and with information from
eValid's PageMap feature, we identifed
the page components that were last to arrive and thus were the
ones upon which to base the synchronization steps.
- We added the DOM Synchronization commands at Step 1, Step 3,
and Step 5 in the script.
- To assure that the final page selection would work reliably,
we constructed an IndexFind + IndexElementClick command to click on
"Ages 4-8".
- Finally, we included a ValidateSelectedObjProperty command to
confirm that the final page arrived successfully.
- ResetTimer and ElapsedTime commands were added to
measure the total time for the playback.
Script
Here is the script that resulted from the steps above.
#
# Copyright © 2010 by Software Research, Inc.
# Recording made on: Microsoft Windows 2000 Service Pack 4 (IE 6.0.2800.1106)
#
ProjectID "Backbase"
GroupID "DukeBook"
TestID "duke"
LogID "AUTO"
ScreenSize 1280 1024
DeleteCache
DeleteCookies
InitLink "http://www.backbase.com/products/ajax_demos/"
ResetTimer
# ORIGINAL: Wait 10595
#
# Step 1: ADDED Synchronize on completion of initial page...
SyncOnSelectedObjProperty 0 203 "nameProp" "dukeBookStore" "readyStateValue" "4" ""
#
# Step 2: Then go to the View Demo page...
FollowLink 0 203 "View demo »" "http://demo.backbase.com:8180/dukeBookStore" ""
SubFrameSet 1 "http://demo.backbase.com:8180/dukeBookStore/"
# ORIGINAL: Wait 43122
#
# Step 3: ADDED Synchronize on completion of this page...
# Screenshot No. 1...
SyncOnSelectedObjProperty 1 82 "className" "btl-listBoxOption-td" "readyStateValue" "4" ""
# ORIGINAL: ElementMouseDown 1 82 "" "Children's Books" ""
#
# Step 4: Select the "Childrens Books" category, ENHANCED using element motion commands...
IndexFindElement 1 DOWN "className" "btl-listBoxOption-td" ""
IndexFindElement 1 DOWN "innerHTML" "Children's Books" ""
IndexFollowLink 1 "" NO_NAV
# ORIGINAL: Wait 12608
#
# Step 5: ADDED Synchronize on this page before the next selection...
# Screenshot No. 2...
SyncOnSelectedObjProperty 1 165 "innerHTML" "Ages 4-8" "readyStateValue" "4" ""
# ORIGINAL: ElementMouseDown 1 165 "" "Ages 4-8" ""
#
# Step 6: Next, Select the "Ages 4-8" category, ENHANCED using element motion commands...
IndexFindElement 1 DOWN "innerHTML" "Ages 4-8" ""
IndexMove 25
IndexFollowLink 1 "" NO_NAV
# ORIGINAL: Wait 20980
#
# Step 7: ADDED an alternative Sync before Validate text on the final page to confirm arrival...
# Screenshot No. 3
SyncOnText 1 "Dirt on My Shirt" ""
ValidateSelectedObjProperty 1 365 "innerHTML" "Dirt on My Shirt" "innerText" "Dirt on My Shirt" ""
ElapsedTime "Total playback time for this run."
# End of script.
|
Screen Shots
- This is the starting screen, after the launch of the demo
from the Backbase page, and after the first DOM synchronization.
- Here is what you see after the second DOM synchronization.
- Here is the page that results after the third DOM synchronization.
This page also shows the "Dirt on My Shirt" line, upon which the
last validation step is based.
Test Results
Here are some of the test results from this script.
- The original running time (the natural recording) was 103.349 secs.
- After AJAX synchronizations were completed, we ran the
script 10 times in succession to get an average time.
-
The timing results were on a fast machine were:
33.707 secs minimum,
35.841 secs average,
40.091 secs maximum.
-
The timing results were on a slow machine were:
68.638 secs minimum,
73.793 secs average,
89.128 secs maximum.
- For stability confirmation we ran the script 100 times in
succession, and no instabilities were noted.
In this run on the slow machine
the playback times ranged from 72.204 secs to 89.018 secs with an average of 76.491 secs.
- We put the script into a 10-wide, 10-deep LoadTest script
on the fast machine
to illustrate operation of the LoadTest capability for this AJAX
application.
In this case the 100 runs averaged 49.425 secs
(minimum 21.550 secs, maximum 69.281 secs).
The total time for the 10-wide, 10-deep playback was 565. secs.