That's what "Aliases" are for. You map the full tree, but then, in the Aliases, you "collapse" the tree into only those things you want. Note the screenshot below showing the same object in the Mapped Objects pane and the Aliases pane...
so, for example, if I have an object that, in the mapping looks like this.
I can then edit my Aliases, moving the text node to be a direct child of the page and delete (from Aliases only) the "irrelevant" items so my Alias looks like this
The Alias is what the test case then uses to reference the object, the NameMapping engine then reads the Alias, associates it with the mapping tree, and then does the necessary algorithms to find the component in your application.
Read https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/overview.html#about-the-mapped-objects-and-aliases-trees and related topics for more information. What you have requested most certainly already exists.
EDIT: Note, this does NOT use extended find. The component is still fully mapped with all ancestry objects so no "Extended Find" is selected and that find search does not occur. The "Aliases" is an interpretation layer between the executed test and the NameMapping engine. There is a GUID stored in the NameMapping.tcNM file that connects the Alias of an object to the NameMapping part of the object.
Related Content
- 4 months ago
- 5 years ago