Forum Discussion
Kitt
3 years agoRegular Contributor
"Ambiguous recognition of the tested" object usually occurs because there're several objects which meet the same recognition criteria. Here are some troubleshooting steps recommended by the [TestComplete reference].
However, it appears as though you are using name mapping to reference an onscreen object instead of a stored image, if this is the case you could just reference the mapped object with the waitAliasChild method and check for the Exists property and handle accordingly
EX:
if (HomePg.NavBarRHDropdown.MainPanel.WaitAliasChild("panelMainMenuContainer" ).Exists):
# returns exists=true if object found
Log.Warning("FAIL - User Prefs found on Main Menu")
else:
# returns exists=false when object is not found
Log.Message("PASS - User Prefs NOT found in Main Menu")
but based on your log reference to the object being 'in focus', you may just be wanting to verify a property of the tested object which you could use the waitProperty method
EX:
obj = HomePg.NavBarRHDropdown.MainPanel.panelMainMenuContainer
if obj.WaitProperty("Enabled", True, 2000):
# object is enabled
Log.Warning("FAIL - User Prefs enabled on Main Menu")
else:
# object is disabled
Log.Message("PASS - User Prefs NOT enabled on Main Menu")
Related Content
- 5 years ago
- 3 years ago
- 7 years ago
- 4 years ago
- 2 years ago
Recent Discussions
- 4 days ago
- 4 days ago
- 7 days ago