Forum Discussion
That's what Aliases are for. You can shorten the hierarchy tree in the Alias part of NameMapping to excluded unnecessary objects in the tree. They'll still be mapped in NameMapping as you have them mapped, but you don't need to utilize them in the Alias.
For example,
NameMapping.Sys.MyApp.MyForm.MyPanel.MySubPanel.MyTextObject
can be "flattened" in the Aliases to just be
Aliases.MyApp.MyForm.MyTextObject
Read up on using Aliases in https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/about.html#aliases-and-mapped-objects
In our application it will add multitude of Namemapping for a single object at each recording. And it can get out of hand. And if I don't take control of Namemapping, the whole thing is unreadable and very hard to understand which objects are no longer working. I don't want generic stuff like Grids, ContentContainer, Borders, ContentPresenter, etc. in namemapping. If an alias doesn't work then I have to run through all those muck in namemapping.
For example, a full name (property) of a specific object in our wpf application will go up to 2933 chars in length with a treelevel of 43.
Sidenote: Ah.. good they put the treelevel back. Perhaps I can use this in stead of parent to solve my problem.
- tristaanogre6 years agoEsteemed Contributor
The adding of multiple objects each time it records is not a problem with TestComplete... it's actually not a "problem". What it means is that the properties being used by TestComplete in the automatic recording are insufficient for unique identification. Alternatively, there could be a dynamic part of the properties being used that changes each time the test runs.
While automatic NameMapping is a good feature of TestComplete, it needs to be tempered with judicious editing and correcting of the mapping. This is a best practice frequently discussed here on the forums.
And, as mentione, that 2933 character lenght full name is something that you DON'T have to reference in your automation. You map the object with the full tree... but then edit the Alias to "contract" the tree to only those parts you actually need in your tests. Please reference the link in my previous post.
NameMapping is a very good tool, when used well. Some of the things you're trying to do with treelevel and parent are already handled by the NameMapping feature.
Related Content
- 9 months agoRichardPla
Recent Discussions
- 3 days agovladd1