RanoreXPath operator precedence

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
HansSchl
Posts: 11
Joined: Wed Sep 19, 2018 10:05 am

RanoreXPath operator precedence

Post by HansSchl » Tue Sep 25, 2018 3:54 pm

I want to specify a RanoreXPath that finds a form which is owned by either process P1 or P2, and which has a well-known window text. Being used to usual operator precedence, I am tempted to write

Code: Select all

/form[(@processname='P1' or @processname='P2') and @windowtext='mytext']
When I press ENTER, Ranorex removes the parentheses, so that I see

Code: Select all

/form[@processname='P1' or @processname='P2' and @windowtext='mytext']
so that I come to doubt whether the 'and' or the 'or' binds stronger in RanoreXPath.

Can anyone comment?

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

Re: RanoreXPath operator precedence

Post by odklizec » Tue Sep 25, 2018 5:00 pm

Hi,

You can use something like this...
/form[@processname~'P(1|2)' and @windowtext='mytext']
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

HansSchl
Posts: 11
Joined: Wed Sep 19, 2018 10:05 am

Re: RanoreXPath operator precedence

Post by HansSchl » Tue Sep 25, 2018 6:24 pm

Great idea! I'll do that :-)