Message - Ambiguous Recognition of the Tested Object

Applies to TestComplete 15.20, last modified on January 19, 2022

About the warning message

Sometimes, a mapped object cannot be found because one of its parent objects could not be uniquely identified. This happens if the identification properties of the parent object match properties of several objects, and the test engine picked a wrong parent object.

TestComplete can resolve ambiguities automatically: when there are multiple matches, it picks the object that is visible. However, it cannot resolve ambiguity when there are several matching objects that are visible, or if all matching objects are invisible (like the browser object). In this case, TestComplete logs the Ambiguous Recognition of the Tested Object warning to bring your attention to the problem.

Diagnosing the problem

To find the object that causes the ambiguous recognition problem:

  1. In the test log, select the line with the appropriate warning message.

  2. Switch to the Details panel.
    This panel contains additional information about the cause of the warning. For instance, it may contain the names of several objects that meet the mapping conditions.

  3. Click the link containing the name of the mapped object in the Details panel.
    TestComplete will open the Name Mapping editor and highlight the needed object in the Mapped Objects tree.

Ignoring ambiguous recognition

Automatic resolution takes time and may slow down your test runs. If it has good results, there is no need to change your tests. In this case, click Disable this warning for the "ObjectName" mapped object. Your tests will ignore the ambiguous recognition for the specified object.

To re-enable the warning, open the Name Mapping editor, select the needed object in the Mapped Objects tree of the Name Mapping editor, right-click in the Properties panel and select Show Ambiguous Recognition Warning

Show Ambiguous Recognition Warning

Resolving ambiguous recognition

If ambiguous recognition causes issues in your tests, first find the object that causes it (for detailed information, see the section above). Select the object in the Mapped Objects tree of the Name Mapping editor. TestComplete will show the mapping conditions for this object in the panel on the right. As it's mentioned above, the warning message indicates that there are several objects in your tested application that meet the specified condition.

So, to resolve the problem, we recommend that you specify a mapping condition that will be met only by one object in the application. If it is impossible, try to rename the objects in your application so that only one of them meets the specified condition.

See Also

Handling the 'Object Does Not Exist' Error
Other "Object Not Found" Errors
Name Mapping
Object Browser Naming Notation

Highlight search results