Page 1 of 1

How to call Location variable in the RanoreXPath?

Posted: Tue Mar 15, 2022 6:20 pm
by QATest879
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.
image.png
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...

Re: How to call Location variable in the RanoreXPath?

Posted: Wed Mar 16, 2022 8:32 am
by odklizec
Hi,

These coordinates are only accessible with cx()/cy() xpath functions. Please check this post, which should help:
https://www.ranorex.info/adding-locatio ... tml#p52960

Or this user guide paragraph:
https://www.ranorex.com/help/latest/ran ... #Functions