RxPath Limitation

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
benny28
Posts: 34
Joined: Thu May 31, 2012 4:48 pm
Location: London
Contact:

RxPath Limitation

Post by benny28 » Fri Oct 09, 2015 11:04 am

Hello,

When I use regular Xpath in webdriver (for example), I can design an xpath like this:

Code: Select all

//div[li[@id='RobustAutomation']]
Using additiona [] brackets allows me to build an xpath backwards while focusing on a specific area of code.

But RxPath does not allow this same format and a syntax error is thrown.

Why does Rxpath have this limitation?
And can it be overcome?
Last edited by benny28 on Fri Oct 09, 2015 12:06 pm, edited 1 time in total.

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

Re: RxPath Limitation

Post by odklizec » Fri Oct 09, 2015 11:40 am

Hi,

Such xpath is simply not compatible with the actual Ranorex xpath implementation. I can only guess it's because Ranorex does not implement latest (full) xpath specification? There are several xpath operators and functions that simply does not work with existing Ranorex xpath implementation.

I'm sorry, I'm not familiar with this kind of syntax, what exactly it should solve? Maybe there is a workaround in existing Ranorex xpath implementation?
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

benny28
Posts: 34
Joined: Thu May 31, 2012 4:48 pm
Location: London
Contact:

Re: RxPath Limitation

Post by benny28 » Fri Oct 09, 2015 2:35 pm

Using the example code in the attachment:

*** Let's say that there are many Route Row's, but that they are Not uniquely named, and we do not want to use numeric's in our xpath (ie. Row 0) because they change.
*** And we want to access a specific Cell 1 'Cell Description Row 0' element
*** Luckily the Cell 2 does have a unique text value e.g Text='Required Data'
*** Therefore an Rxpath of

Code: Select all

//Table/Row[@accessiblename='Row 0']/Cell[@accessiblename='Description Row 0']
is not good enough.

* If I was using regular xpath I would do this:
* Begin with focusing on

Code: Select all

//Row[@Cell~'WorkItemComplete' and @Text='Required Data']
* Then build the xpath backwards using []brackets to focus on the large area:

Code: Select all

//Table[Row[@Cell~'WorkItemComplete' and @Text='Required Data']]/Cell[@accessiblename='Description Row 0']
So as you can see. it is a very useful and powerful aspect of regular xpath.
So to reiterate my original questions : )
Why does Rxpath have this limitation?
And can it be overcome?
Attachments
CodeExample.png
CodeExample.png (2.95 KiB) Viewed 756 times
Last edited by benny28 on Mon Oct 12, 2015 2:55 pm, edited 1 time in total.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: RxPath Limitation

Post by Support Team » Mon Oct 12, 2015 11:55 am

Hello benny28,

As Pavel already mentioned, the RanoreXPath is based on XPath, but doesn't support all the features and expressions XPath supports, so it includes just a subset of it.

As far as I understood your requirement, you try to access the row [Row “Row” 0] based on the underlying cell, correct? If so, then you could do the following:

Code: Select all

//Table/Row[@accessiblename='Row 0']/Cell[@accessiblename='Description Row 0']/..
Regards,
Robert
.
Image

benny28
Posts: 34
Joined: Thu May 31, 2012 4:48 pm
Location: London
Contact:

Re: RxPath Limitation - SOLVED

Post by benny28 » Mon Oct 12, 2015 4:18 pm

Wow excellent, I was unaware of the:

Code: Select all

/..
feature in RxPath. That's exactly what I was talking about.

For anyone else reading this, Ranorex example found @
http://www.ranorex.com/support/user-gui ... xpath.html

> Advanced RanoreXPath Example
> identify a GUI element not having unique attributes

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: RxPath Limitation

Post by Support Team » Tue Oct 13, 2015 8:30 am

Hello benny28,

I'm glad that I could help.

Kind regards,
Robert
.
Image