Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98221

Or condition on ancestors in XPath?

$
0
0

I am trying to phrase a XPath which would look somewhat like this.

//div[@class='foo']/ancestor::(fieldset or div)[@class='foo1']

But XPath is not working at this point (fieldset or div)

A long XPath like the one below is working,

(//div[@class='foo']/ancestor::fieldset[@class='foo1'] or //div[@class='foo']/ancestor::div[@class='foo1'])

But, is there any concise way to build this XPath?


Viewing all articles
Browse latest Browse all 98221

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>