background image
<< Using the GUI Record and GUI Insert Toolbars | Switching to Low-Level Recording >>
<< Using the GUI Record and GUI Insert Toolbars | Switching to Low-Level Recording >>

Defining Unknown Objects During Recording

Recording GUI Scripts
2-20
Defining Unknown Objects During Recording
As explained in Controlling How Robot Responds to Unknown Objects on page 2-7, Robot
recognizes all standard Windows GUI objects and many custom objects. You can
also set a recording option so Robot automatically associates unrecognized objects
with the Generic object type.
If you have not set this option, Robot displays the Define Object dialog box if you
click an object that Robot does not recognize. Use this dialog box to map the object
to a known object type.
To define an unknown object while recording:
1. From the Type list in the Define Object dialog box, select an object type to
associate with the unknown object.
If possible, select an object type that is appropriate for the object you are
defining. For example, if the unknown object is a custom toolbar that has the
same behavior as a standard Windows toolbar and supports the same
programmatic interface, select Toolbar from the Type list. By mapping the
object to a known object type, you make your script more readable; and Robot
can test the special properties associated with that object type. Also, Robot can
identify the object more accurately by using the object recognition methods.
However, using an incorrect object mapping can cause problems during
playback. For example, an object might look and act like a standard toolbar but
might actually not respond correctly to the messages that are sent to a standard
toolbar. If you are not sure which type to use, select Generic. Robot can test the
basic set of the object's properties and uses the object's x,y coordinates to locate
the object.
This unknown object...
... will be mapped to the
object type that you select...
... based on the class name
of the window associated
with the object.