TestProject Forum
Powered by leading experts in the test automation community

Evaluate all XPaths with selenium

Can selenium evaluate all elements that may match a given Xpath?

If my page has a list of buttons, i would like to get them all with //button and check that they don’t have ‘disabled’ attribute before clicking on them

try constructing an xpath that will return all buttons without the ‘disabled’ attribute:

"//button[not(@disabled)]"