background image
<< Recording Mouse Movements | Chapter 14 Testing Java Applets and Applications >>
<< Recording Mouse Movements | Chapter 14 Testing Java Applets and Applications >>
Robot uses recognition methods
Testing HTML Applications
13-18
Enhancing Object Recognition of HTML Elements
Robot uses recognition methods to identify HTML elements in the
application-under-test. These recognition methods are saved as arguments in scripts
to help Robot identify these elements during playback. For example, Robot can
identify a link by the visible text of the link -- that is, the text that a user clicks on. If
this text changes after a script has been recorded, the script may fail when it is played
back.
The best way to ensure that Robot recognizes this link is to assign it an ID that will
always remain the same, even if the visible text changes -- for example:
See <A HREF="about.htm/" ID=about> About Our Product</A>
To enhance the recognition of image elements, it is best to use either ALT tags or ID
tags, as shown in the following examples:
<A HREF="lookup.htm" ><img src="lookpix.gif"
border =0
alt="Lookup a
document"
></A>
<A HREF="search.htm"
><img ID="SearchButton" src="searchpix.gif"
border=0></A>
For more information about recognition methods, see the SQABasic Language
Reference
.