What are object names?

Last edited on

For most GUI toolkits, Squish identifies AUT objects by their properties. But rather than using all of an object’s properties, Squish uses just those that are likely to be stable. For example, Squish won’t normally use an object’s x, y, coordinates since the object might be moved in the user interface without actually affecting the AUT’s behavior. On the other hand, Squish will usually use a text or caption property since that is likely to remain the same.

Squish typically creates unique identifying names for AUT objects based on their properties. Such names are called real names or multi-property names, and have the form {propertyName1="propertyValue1" propertyName2="propertyValue2" ...}.

In recorded test scripts Squish identifies AUT objects using symbolic names. These are short strings that begin with a colon. The Squish Object Map relates every symbolic name to a real name. The advantage of this scheme is that should the AUT’s developers change the value of a property, for example, change the text of a button, instead of having to change the text property for that button in every test script that refers to it, it is only necessary to change the text property once, in the Object Map, since whenever a test is run Squish looks up each symbolic name in the Object Map to find the properties that match the relevant object: and if these properties have been updated then the updated object will correctly be found.

Because of the convenience of only having to update the Object Map if an object’s properties change, it is best to use symbolic names in test scripts (and these are the kind of name that Squish uses when recording tests). However, it is possible to use real names if you want to, and this can sometimes be convenient when you want to compute object names on the fly.

To view the Object Map click the Object Map toolbar button in the Test Suite view.

See also Object Map, Object Name Generation, Improving Object Identification, and Object Map view in the Tool Reference Manual. In addition, the User Guide has examples showing how to create names programmatically for some toolkits.