Overview¶
Some facts about the object map:
The number of entries in the object map is not limited.
The number of entries in the object map does not affect performance of replaying test scripts.
The number of entries in the object map does affect performance of recording test scripts, because Squish must re-use (already existing) object names in the object map while recording (as opposed to always creating new objects names - which would introduce the kind of object name redundancy that the object map is supposed to avoid), and to achieve that, it has to check all object names to find the ones that it can re-use. And the more object names there are to check, the slower the check will be.
The number of entries in the object map should roughly equal the number of GUI objects that all test cases in that test suite interact with (plus some more for window and container objects).
Checking the number of entries in the object map¶
When checking the number of entries of the object map (by default in the file TEST_SUITE_DIR/shared/names.*
) the following questions may be helpful to consider:
Question #1:
If you have a large number of object names in the object map (possibly hundreds or thousands), are your test scripts interacting with approximately that number of different GUI objects? Does your application have thousands of different GUI objects?
Note 1.1: "Different GUI Objects"
The "same" window object but with (slightly) different window title should typically not have more than one object name.
This avoids the object name duplication described in IMPORTANT - Adjust object names for objects with changeable texts early .
Note 1.2: Object names for container items, cells, nodes
Objects in list, tree or table, etc. containers, such as items, notes, cells, etc. should only get their own symbolic names when there is a handful of them to interact with.
(When interacting with hundreds or thousands of them, consider letting your script generate Real Names at script runtime to look up these objects instead. (Loosely related: How Squish looks up Real Names from Symbolic Names )
Question #2:
Is there any redundancy in the object names?
Note:
Here is an example of a very simple, yet relatively "expensive" redundancy (full duplication of object names):
Here is a script you can run on your object map to clean things up after you have adjusted your object names to be general enough.