Tracking same element get another repo item

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
henrikw
Posts: 5
Joined: Tue Sep 17, 2019 10:19 am

Tracking same element get another repo item

Post by henrikw » Thu Mar 05, 2020 4:49 pm

Ranorex 9.3

Hi,

So, I have started creating an object repository for a web app. It consist of forms where I had to manually edit the rxpath in order to uniquely identify them based on their labels. Everything good and it worked.

However when I track the same elements again I get a new repository items. It will not highlight the ones I have already uniquely identified by manually editing them.

Any ideas why it behaves like this?

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: Tracking same element get another repo item

Post by Stub » Fri Mar 06, 2020 8:34 am

Something in your RxPath will have changed. An index, a wildcard, some variable runtime attribute, etc. I would examine the RxPaths that you used previously and the new paths to the element you're after, and eliminate whatever is causing the variability.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Tracking same element get another repo item

Post by odklizec » Fri Mar 06, 2020 8:37 am

Hi,

Once you change the xpath of a repo element, it's not the same element anymore ;) Therefore, Ranorex uses actual xpath weight, to create a new repo element.

Ranorex adds elements to repository, based of the xpath weight, where each element has its weight value. Higher weight value means higher priority in xpath construction process. For example, attribute ID has highest priority, then InnerText, TagValue, etc.... If you wish that Ranorex for example prioritizes Class attribute over ID (good in case of Android or Angular), you need to set the weight value of Class attribute higher than ID attribute.

For more details about setting xpath weights see this article...
https://www.ranorex.com/help/latest/ran ... e-weights/
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

henrikw
Posts: 5
Joined: Tue Sep 17, 2019 10:19 am

Re: Tracking same element get another repo item

Post by henrikw » Thu Mar 19, 2020 11:42 am

I made the developers adding unique ID's to our web app for buttons, forms, drop lists, checkboxes, radio buttons, error messages etc.

Now when I track i get that ID which is convenient. But it becomes almost too robust I fear but I'm not sure. Doesn't matter if i adjust the slider in Settings>Advanced, it will still create the same path.

But maybe this is good? :)

ex.

Code: Select all

/dom[@domain='172.xx.xx.xx:3002']//button[#'hcpLoginLogin']

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: Tracking same element get another repo item

Post by Stub » Thu Mar 19, 2020 2:27 pm

I've not fiddled with that slider myself, but you might be able to adjust the Ranorex Xpath weight rules to guide how it identifies elements. I've only recently started having a play with this area myself. While I was looking at it in a different context, I was able to largely control and guide the generated RxPaths for our application.