Similar UI element names with different Ranorex paths

Best practices, code snippets for common functionality, examples, and guidelines.
Posts: 3
Joined: Fri Jul 28, 2017 1:30 am

Similar UI element names with different Ranorex paths

Post by erik » Wed Sep 13, 2017 6:54 am


I have 2 UI elements (i.e. button) from 2 separate screens.
These elements have the same element name, let's say Button1.
They belong to 2 separate screens(Screen A and B) and their Ranorex paths(Path1 and 2) are also different from one another.
However, they are treated as the same item when I try to place them both on the item repository.

I performed a Mouse Click action to Button1 of Screen A on Recording Module A and
also performed the same Mouse Click to Button1 of Screen B on Recording Module B.
When I execute Module B however, an error occurs since it could not locate Button1.

Is there a way to work over this?
Still new to Ranorex and would appreciate it if anyone could help me on this.

Thank you.


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

Re: Similar UI element names with different Ranorex paths

Post by odklizec » Wed Sep 13, 2017 7:04 am

Hi Erik,

Could you please upload a Ranorex snapshot (not screenshot!) for both buttons, xpath recorded in repo and exact error message you are getting?

If I understand you correctly, recorder thinks the button is the same for both screens so it does not create separate repo items? I think you will have to manually enter different xpath for each button. Unfortunately, it's too hard to suggest something reliable without, at very least, snapshot of the problematic element.
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