Niraj Singh
Niraj Singh

Reputation: 11

Unable to click on checkbox in Selenium

I have tried xPath, CssSelector, tagName, Name, id but it always throw an error that "element not visible"

HTML is

<div class="alertType nonEv" style="display: block;">
<span style="font-family:designk-bold; font-size:x-large; color:#444">MAINTENANCE & DIAGNOSTICS ALERTS</span>
<br>
<ul>
<li>
<span>500 miles before maintenance</span>
<input id="" class="checkbox" type="checkbox" value="Y" name="">
<label class="noShow"></label>
<input id="" class="checkbox" type="checkbox" value="Y" name="">
<label class="noShow"></label>
<input id="maint100" class="checkbox" type="checkbox" value="Y" name="maint100">
<label class="col3" for="maint100"></label>
</li>

Please help

Upvotes: 1

Views: 456

Answers (1)

AxelPaxel
AxelPaxel

Reputation: 143

If you get an ElementNotVisibleException that indicates that you have actually located the element you want to interact with. In short, an ElementNotVisibleException means that the element you are trying to interact with is either hidden or overlayed by another element.

If the problem was that you could not locate the desired element, you should be getting an NoSuchElementException. A such exception indicates that there are no elements that match the conditions used when trying to locate the element(s).

Upvotes: 1

Related Questions