Variable in XPath of Repository Item - how to root?

Ranorex Spy, Recorder, and Studio.
loonquawl
Posts: 49
Joined: Wed Nov 22, 2017 10:08 am

Variable in XPath of Repository Item - how to root?

Post by loonquawl » Fri Nov 24, 2017 4:11 pm

Hi.
I'm looking into variables as part of the path of a repository item.
In the repository i choose an object, and click on "Edit Path in Spy" - A path editor opens, an i can assign variables to parts of the path, but only to a certain depth, the rest is greyed out, and if i try to assign a variable it says "... please edit the parent folder ... " but that would affect all child-objects of that folder, would it not? how can i assign a variable to a deep parent of an object without affecting all children?
Thanks!

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

Re: Variable in XPath of Repository Item - how to root?

Post by odklizec » Fri Nov 24, 2017 6:00 pm

Hi,

The reason why you cannot edit the grayed-out part of the xpath is that it belongs to a parent (rooted) folder. In other words, if you want to edit the 'disabled' part of xpath, you need to go to and edit the parent repo folder. And yes, if you place a variable in rooted folder, it will affect all children placed in this folder. If you want to avoid this behaviour, then the only way is to create a copy of rooted folder a insert inside only the elements you want to be affected by the variable added to rooted folder xpath.
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

loonquawl
Posts: 49
Joined: Wed Nov 22, 2017 10:08 am

Re: Variable in XPath of Repository Item - how to root?

Post by loonquawl » Wed Nov 29, 2017 7:47 am

Thank you.