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:
However, when I run the xPath in code, it fails:
org.openqa.selenium.TimeoutException: Timed out after 15 seconds waiting for ...
If I search for a "normal" checkbox (without the disabled attribute and on the same page), code works. So I'm pretty sure it is this disabled="disabled"
attribute that is to blame.
Simplified HTML:
<div class="wfm-statusbar">
<div>
<span> some text</span>
<span>
<label>
<input type="checkbox" disabled="disabled" >
</label>
</span>
</div>
</div>
Any suggestions? Thanks.