Forum Discussion
OK... are you doing this editing in the Mapped Objects panel or the Aliases panel? It does make a difference.
Also, are you using the "Extended Find" option on any of these objects?
Basically, here's what I would do...
1) At this point in time, if there's no "problems" with mapping and extra panels, I wouldn't change anything in the Mapped Objects panel. That can be left exactly the way it is.
2) In the Aliases panel, drag the "Cell" object to be a child of the "Screen" object. You'll now have something that looks like
- Screen
- Cell
- Panel
- Table
-Table
3) Right click on "Panel" and select Delete.
4) There will be a prompt that will say something about "Do you want to delete this alias and it's child aliases?" Say Yes
5) There will be ANOTHER prompt that will ask if you want to delete the mapped items as well... say NO.
So... Mapped objects will still have the original hierarchy... but Aliases will now simply have
- Screen
- Child
And that's what you'll use in your test cases.
Just to explain... there are two layers to NameMapping... There's the Mapped Objects which is the actual configuration for finding and identifying objects (see my previous response to you describing how that works). Then there's Aliases. Aliases are a way of translating the Mapped Objects into something that is more usable. As you said, you don't care, really, about all the panels and tables. They can still be present for identification but you can adjust your Alias to be more meaningful to you.
Is it possible to link children to a fake alias?
For example
we have 2 screens. Login and Login_2
Id like the aliases to look like this
- LoginScreen
- UsernameTB
- PasswordTB
- PinTB
But since we have 2 pages, it comes out like this
- LoginScreen
- UsernameTB
- PasswordTB
- LoginPinScreen
- PinTB
Id like the LoginScreen to be a fake alias. and have the children mapp to their correct urls.
- tristaanogre8 years agoEsteemed Contributor
Every item in Aliases must have a representation in Mapped Objects. Remember, mapped objects does the identification. So, if there's an item in Aliases, TestComplete tries to go to that item and check the Mapped Objects to see if it can identify it, inclduing parent objects. The Aliases need to represent something of the hierarchy of the Mapped Objects... so, if PinTB is not somewhere in the descendant tree of LoginScreen, you can't make it a child of LoginScreen in the Aliases. Again, keep in mind, Aliases is a translation of Mapped Objects but it still needs to follow, somewhat, the logic of Mapped Objects with regards to identification.
The logic would be, to identify PinTB, it would first need to identify the parent. So.... in what you want, it would first go to LoginScreen and identify it. Then it would say, "Find the child of LoginScreen that matches the criteria of PinTB". Because PinTB is not an actual child of LoginScreen, this identification will fail.