OR condition in XPath

Best practices, code snippets for common functionality, examples, and guidelines.
prasoon.jmit
Posts: 13
Joined: Mon Dec 09, 2019 1:37 pm

OR condition in XPath

Post by prasoon.jmit » Thu Dec 19, 2019 12:01 pm

Hi,

Can I use OR condition in XPAth?

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

Re: OR condition in XPath

Post by odklizec » Thu Dec 19, 2019 12:14 pm

Hi,

Yes, you can use conditions in Ranorex xpaths. For example like this:

Code: Select all

element//container/button[@accessiblename='Close' or @accessiblename='' and @accessiblerole='PushButton' and @visible='true']
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