How to call Location variable in the RanoreXPath?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Posts: 31
Joined: Fri Jul 02, 2021 2:35 pm

How to call Location variable in the RanoreXPath?

Post by QATest879 » Tue Mar 15, 2022 6:20 pm

To elaborate: Here is the issue:

The element I'm looking (div) at has a "Location" (different from ScreenLocation). And the Location has an X and Y in it. X=5 and Y=9.
How do I make a RanorexPath that gets the element at location X=5? I already know the rest of the path I just need the part where I assign the object based on its location. Nothing else has X=5 of that type so that's all I need to do.

I tried div[@Location.X=5] but it didn't work. I assume I'm doing the syntax wrong. Does anybody know the proper syntax for a scenario like this?

For example for a normal variable like visible you can do [@visible='true'] but what if you want to do location.x instead? I 'can't' do [@location.x='5'] it doesn't work for some reason...
You do not have the required permissions to view the files attached to this post.

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

Re: How to call Location variable in the RanoreXPath?

Post by odklizec » Wed Mar 16, 2022 8:32 am


These coordinates are only accessible with cx()/cy() xpath functions. Please check this post, which should help: ... tml#p52960

Or this user guide paragraph: ... #Functions
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