4

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

user3364652
  • 480
  • 8
  • 23

1 Answers1

7

Just use //element[@someAttribute] for your XPath expression.

Markus
  • 3,155
  • 2
  • 23
  • 33