Page 1 of 1

RanoreXPath operator precedence

Posted: Tue Sep 25, 2018 3:54 pm
by HansSchl
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?

Re: RanoreXPath operator precedence

Posted: Tue Sep 25, 2018 5:00 pm
by odklizec
Hi,

You can use something like this...
/form[@processname~'P(1|2)' and @windowtext='mytext']

Re: RanoreXPath operator precedence

Posted: Tue Sep 25, 2018 6:24 pm
by HansSchl
Great idea! I'll do that :-)