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
  • 473
  • 7
  • 20

1 Answers1

7

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

Markus
  • 3,043
  • 2
  • 20
  • 30