Extended Search

Applies to TestComplete 14.30, last modified on November 21, 2019

The Name Mapping repository stores information on the object location in the application’s object hierarchy and uses it to find the objects during the test run. You can configure your Name Mapping repository to search for an object on all levels down the hierarchy rather than just on the current level.

When to use extended search

Dynamic object hierarchy

In dynamic applications, the same object can be at various positions in the object hierarchy depending on the application state:

An object moving through the object hierarchy
An object moving through the object hierarchy

To identify such “roaming” objects, configure TestComplete to ignore their dynamic parents. To do this, map a “roaming” 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

Sometimes, a mapped object has 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.

How to enable extended search

Globally

By default, when mapping objects, TestComplete tries to use extended search where it is possible. To control this, use the Engines > Name Mapping > Use extended find when possible option.

For a single object
  1. In the Name Mapping editor, locate the object in the Mapped Objects tree.

  2. If the Extended Find column is hidden in the tree, make it visible:

    1. Right-click anywhere in the tree and then click Field Chooser.

    2. Drag the Extended Find column from the resulting Customization window to the editor.

  3. Drag the object to the closest non-dynamic parent object:

    Dragging a mapped object up the object tree
  4. Select the Extended Find check box for the object:

    Enabling extended search

    If a confirmation dialog appears, click Yes.

  5. If needed, in the Aliases tree, update the object’s alias to match the changes in the Mapped Objects hierarchy.

    Note: The hierarchy of mapped objects and aliases must not contradict the parent-child relationships of the corresponding objects in the application.
  6. If needed, delete unneeded intermediate objects from the Mapped Objects and Aliases trees.

Update the object name in your tests after you change the Name Mapping structure. In keyword tests, TestComplete will suggest to update the name automatically. In script tests, update the name manually.

Alternatives to extended seach

To search for objects in tests, you can use:

In this case, you specify the identification properties and values directly in your test. In addition, you can limit the search depth to make the search faster.

For more information on using the search methods, see these topics:

Notes

  • Extended Find searches down the entire object hierarchy. The search is not depth-limited.

  • Extended Find uses breadth-first search, regardless of the value specified in the Object search strategy project property (it affects the Find methods only).

  • Searching for objects in large applications may take a long time. If you get warnings in the test log that a search takes too much time, try doing the following:

See Also

Name Mapping
About Name Mapping

Highlight search results