Wednesday, June 24, 2009

Recording Autosuggest Text Boxes

In the last couple of months some of the most popular search engines have added a new "autosuggest" feature into their primary search window. When you type a character or two the search engine adds in some possible suggestions for what you might want to search for, and you can either click on the suggestion of keep typing characters and seeing more suggestions.

To be clear, this activity is done with an AJAX process in which the browser interacts with the server to make suggestions from its lexicon of search terms. [A related concept, called "autocomplete", relies on the use local search history and maybe what is stored locally in cookies, but that is NOT done with dynamic AJAX interactions.]

In all the cases we've seen, however, if you type enough characters into the text box eventually the search engine gives up and stops making suggestions. At that point, you have a regular non-AJAX text box (see below).

The question then becomes, what does this mean in terms of testing? How do you record a test (or hand script a test) to account for this kind of dynamic behavior?

The first thing to note is that after some point, the autosuggest feature stops making suggestions. So in this case you can record your test as you always have, because the behavior is the same as if there the autosuggest feature isn't there.

Where it becomes tricky is when you DO want to record -- and maybe even validate -- the behavior of the AJAX-based autosuggest processing of a text entry. Just to be clear, you certainly can do this with eValid, but you have to be reasonably careful about how you go about it.

To make it simple we've made up a simple step-by-step Recording Autosuggest Text Boxes recording protocol that shows how easy this is to do. Let us know if you have any trouble following the protocol.

No comments: