Name Mapping has an object-specific option, Extended Find, that makes TestComplete search for an object on all levels down the application’s object hierarchy. Extended Find is typically used when an object has dynamic parent objects, and these parent objects are not included in Name Mapping.
If the Use extended find when possible option is enabled, TestComplete maps web objects by using the Extended Find feature. For objects of other application types, you can configure the Extended Find option manually as explained in this topic.
How to Enable Extended Search
First, add the Extended Find column to the Name Mapping editor:
Right-click somewhere within the Mapped Objects pane and select Field Chooser from the context menu. This will open the Customize window with the list of the available columns.
Drag the Extended Find column to the Mapped Objects pane.
Close the Customize window.
To enable Extended Find for an object, do the following:
In the Mapped Objects tree, drag the object to the closest non-dynamic parent object.
Select the Extended Find check box for the object.
If a confirmation dialog appears, click Yes.
In the Aliases tree, drag the object’s alias to the matching parent alias (like you did in the Mapped Objects tree).
Delete unneeded intermediate objects from the Mapped Objects and Aliases trees. To delete an object, right-click it and select Delete from the context menu.
Remember to update the object names in your tests after you change the Name Mapping structure.
When to Use Extended Search
Dynamic Object Hierarchy
In dynamic applications, the same object can be at different positions in the object hierarchy in different application states.
An object moving through the object hierarchy
To correctly identify the “moving” objects, you need to ignore their dynamic parent objects. To do this, map a "moving" object (in the example above it is Panel("Dock1")) to the closest non-dynamic parent object (Table(0) or Panel("BackgroundZone")) using Extended Find.
Non-Unique Parent Objects
Some objects have no unique properties. For example, the DIV and TABLE elements used to lay out web pages are often identified only by indexes, and these indexes can be dynamic.
You can exclude non-unique parent objects from Name Mapping to make child object identification more robust. You need to turn on Extended Find for each object whose direct parent object is not included in Name Mapping.
Too Long Aliases
Large applications can have a highly nested object hierarchy. As a result, the object aliases in the default generated Name Mapping repository can be very long. This can be an issue if you create tests manually.
You can use the Extended Find option to exclude intermediate objects from Name Mapping and shorten the aliases.
Name Mapping for a web application without Extended Find (on the left) and with Extended Find (on the right)
In the example above, the full alias of the linkLogout object is as follows (the differences are marked with blue):
Without Extended Find:
With Extended Find:
Alternatives to Extended Find
Instead of using Name Mapping with Extended Find, you can search for objects from tests:
In this case, you specify the identification properties and values directly in your test. Also, the
FindChild method lets you limit the search depth to make the search faster.
For more information on using the search methods, see these topics: