cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to cut out the long hierarchy when adding elements to Name Mapping

SOLVED
Contributor

Is there a way to cut out the long hierarchy when adding elements to Name Mapping

I have an element on the UI and when added to the name mapping repository it looks buried under a long hierarchy  of panels, and this is how it appears when recording an action on this element

 

 

browser.pageEpadminstg.panel.panelVertical.panelTopPane.panelHorizontal.panelLeftPane.panel.panel.panelTabstrip.panelTabstrip1.panelNotificationsgrid.panel.buttonEvent.ClickButton()

 

 

I'm sure there is a high chance of some of the panel elements (basically div tags) getting removed/added if a developer makes a slight change to the layout, resulting in failure to identify the element. So is there a way to directly narrow down to the actual element like 

 

 browser.pageEpadminstg.buttonEvent.ClickButton()

It looks very simple when i use the xpath, but it gets very slow when executing on a VM - 

 

HomePage.FindChildByXPath("//button[@id='addButton']").click()

I'm curious to hear from other users to understand how they manage their name mapping repositories.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Is there a way to cut out the long hierarchy when adding elements to Name Mapping

Read up on "Extended Find".  I typically do not have that turned on by default.  But it is useful for compressing those DIV tags.  Note that by using Extended Find, the trade off is on performance because it will take some time to search.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Re: Is there a way to cut out the long hierarchy when adding elements to Name Mapping

Read up on "Extended Find".  I typically do not have that turned on by default.  But it is useful for compressing those DIV tags.  Note that by using Extended Find, the trade off is on performance because it will take some time to search.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Community Hero

Re: Is there a way to cut out the long hierarchy when adding elements to Name Mapping

Note, also, that there is a difference between a Mapped Object and the Aliase that you use in your automation.  You can map a LOT more objects but then still compress them in your Alias to only those you need.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Community Hero

Re: Is there a way to cut out the long hierarchy when adding elements to Name Mapping

Absolutely, this is exactly what the Alias part of mapping is for. You can keep the full tree mapped and rearrange your aliases to shorter more concise pieces.

 

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/abou...


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Contributor

Re: Is there a way to cut out the long hierarchy when adding elements to Name Mapping

Thank you! very helpful