|
Synopsis
Many applications now include AJAX-implemented autosuggest functions.
A good example of this is the basic
Google Search Function,
which uses an AJAX capability to interrogate Google databases
and make suggestions on a likely search target based on keyword matches found on their server.
This example script uses eValid index/motion and DOM manipulation commands to exercise this AJAX application.
Completed Script
The final recorded script is shown here.
# Recording by eValid V9 # Copyright 2012 by Software Research, Inc. ProjectID "Project" GroupID "Test" TestID "autocomp" LogID "AUTO" ScreenSize 1152 864 DeleteCache DeleteCookies # Step 1: Navigate to starting page... InitLink "http://www.google.com/" SyncOnElementProperty 0 "value" "Google Search" "" # Step 2: Find the text entry box... IndexSet 0 IndexFindElement 0 DOWN "name" "q" "" # Step 3: Feed in the "zzzz" data... IndexInputValue 0 "TEXT" "zzzz" "" "" # Step 4: Make sure the pulldown table is populated... SyncOnElementProperty 0 "tagname" "TABLE" "" SyncOnElementProperty 0 "className" "gac_m" "" # Step 5: Re-position the sourceIndex to trigger the pulldown listings... IndexMove +2 IndexElementEvent 0 "onkeydown" "keyCode" "40" "" # Step 6: Synchronize to assure that the list items show up... SyncOnElementProperty 0 "b" "true" "" SyncOnElementProperty 0 "completeID" "0" "" # Step 7: Choose "best company" by name, and click on it... IndexFindElement 0 DOWN "innerText" " best company" "" IndexElementMouseDown 0 "" IndexElementClick 0 "" # Step 8: Study the result screen that results from this search... # End of Script