mardi 21 juin 2016

Make Selenium find checkbox with disabled="disabled"

I'm trying to grab a checkbox with disabled="disabled" attribute using:

 List<WebElement> checkBox= driver.findElements(By.xpath("xpath")); 

Where "xPath" is one of:

(.//*[contains(@class,'wfm-statusbar')])[1]/descendant::input

(.//*[contains(@class,'wfm-statusbar')])[1]/descendant::*[@type='checkbox']

(.//*[contains(@class,'wfm-statusbar')])[1]/descendant::*[@disabled='disabled']

ALL of the above work when checked in FirePath and Console. Example proof:

enter image description here

However, when I run the xPath in code, it fails. If I search for a "normal" checkbox, code works. So I'm pretty sure it is this disabled="disabled" attribute that is to blame.

Any suggestions? Thanks.




Aucun commentaire:

Enregistrer un commentaire