Forum Discussion
The parent property IS available for use in the tests. You don't need to add the parent property to your mapping to use the parent within the automation itself.
Additionally, if you map the parent object itself and then put the child object as a descendent in the mapping tree, it will ensure that you're always getting the proper child object.
So... no need to downgrade, just better usage of the objects and namemapping feature.
I mostly use that. But our WPF appication already have a humongous object tree. Even by using extended find, the namemapping are pretty long (the longer it is the more difficult it is to read). So sometimes I use Parent property just for a specific object.
Too bad Parent object is now gone. It was a nifty thing to use without breaking the namemapping.
Thanks anyhow.
- tristaanogre6 years agoEsteemed Contributor
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.MyTextObjectcan 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
- DodongAmaw6 years agoNew Contributor
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
- 3 years agoTestee
- 8 months agoRichardPla
Recent Discussions
- 6 hours agojstaehlin
- 24 hours agoAivanitskiy