|
Summary
The simple AJAX
Autocompleter demo
represents a "perfect storm" of sophisticated AJAX page properties.
Testing them thoroughly efficiently demonstrates
how to approach test design with eValid facilities.
About The Application
This page has a very simple, but quite sophisticated, AJAX feature.
As you type individual letters into the "Just a little test:" area
(see the picture below) the internal implementation searches a
backend database and suggests possible results for you.
These show up in a drop-down list on the screen, automatically,
after a few seconds (while the backend database looks up the
information).
As you type in more and more letters the response after every keystroke is a new list, updated to contain only the matching responses. Adding characters that "don't match" also updates the data (you may not see a change visibly, but it is being done).
To test this page you need all of the following kinds of features:
As the script below shows, all of this work is done with index motion commands that manipulate the DOM and with special AJAX synchronization logic that waits until the backend database work is completed by sensing a signal inside the page.
About the Script
The eValid script performs these steps (see the script, which has
been annotated to correspond to these numbers):
# Recording by eValid(TM) # Copyright (c) 2000-2012 by Software Research, Inc. # Recording made on: Microsoft Windows 2000 SP3 ProjectID "Project" GroupID "Findex" TestID "scriptaculous" LogID "AUTO" ScreenSize 1280 1024 FontSize 0 DeleteCache DeleteCookies # Step 1 InitLink "http://demo.script.aculo.us/ajax/autocompleter" # Step 2 IndexFindElement 0 DOWN "id" "contact_name" "" IndexInputValue 0 "TEXT" "Ant" "" "" IndexElementEvent 0 "onkeypress" "" "" "" # Step 3 SyncOnElementProperty 0 "id" "contact_name_auto_complete" "" SyncOnElementProperty 0 "zIndex" "2" "" # Step 4 IndexFindElement 0 DOWN "tagName" "UL" "" IndexFindElement 0 DOWN "innerText" "Antonio Edgar" "" IndexFindElement 0 DOWN "autocompleteIndex" "3" "" IndexElementClick 0 "" # Step 5 ValidateSelectedObjProperty 0 0 "id" "contact_name" "value" "Antonio Edgar" "" # End of script. |
Example Operation
Here is a step by step illustration of the operation of the script,
showing the screen state after every step: