I know this way I can find element by attribute and value:
webDriver.findElements(By.xpath("//element[@someAttribute='someValue']"))
How can I find all elements that has the attribute someAttribute
no matter what the value is?
Thanks
Just use //element[@someAttribute]
for your XPath expression.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With