XPATH support

Ask general questions here.
radimag
Posts: 12
Joined: Tue Jul 17, 2018 8:15 am

XPATH support

Post by radimag » Tue Jul 17, 2018 8:57 am

Hi,

Does Ranorex support translate or matches function in XPATH?
First thought, it seems not. But I prefer to-do a double check.

Documentation of both functions can be found on the official w3 xpath function page. (Can't post urls)

Thanks in advance!

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: XPATH support

Post by Support Team » Wed Jul 18, 2018 9:09 pm

Hi radimag,

While RanoreXPath is based on XPath, it doesn't support all the features and expressions XPath supports at this time (including the translate and matches functions). If are you able to provide more detail to what you are trying to do, I will be happy to look into another method to achieve this.

Cheers,
Ned

radimag
Posts: 12
Joined: Tue Jul 17, 2018 8:15 am

Re: XPATH support

Post by radimag » Thu Jul 19, 2018 10:08 am

Thanks for the answer.

I'm trying to ignore case-sensitive in a xpath.

Example:
Find div tag with attribute name that contains the value 'example' without case-sensitivity

Code: Select all

<div name="This is an ExAmPle name">test</div>
.//div[@name~'example'] 

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

Re: XPATH support

Post by odklizec » Thu Jul 19, 2018 2:18 pm

Hi,

You can use regular expression, to ignore character case, like this:

Code: Select all

.//div[@name~'(?i:example)']
Hope this helps?
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

radimag
Posts: 12
Joined: Tue Jul 17, 2018 8:15 am

Re: XPATH support

Post by radimag » Tue Jul 24, 2018 12:15 pm

Thanks odklizec, this solved the problem.

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

Re: XPATH support

Post by odklizec » Tue Jul 24, 2018 12:32 pm

Hi,

I'm glad to hear that ;)
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