Vdev Vdev - 11 months ago 80
HTML Question

Proper xpath for identifying the checkbox

I am trying to write an selenium script using

on the checkbox but am unable to perform the operation rather i am getting an error

Element is not clickable at point (210.5, 616). Other element would receive the click: Command duration or timeout: 75 milliseconds


<div style="float:left;">
<label class="enhanced-checkbox" for="lender_user_privacy">
<i class="icon"/>
<input id="lender_user_privacy" class="ui-helper-hidden-accessible" type="checkbox" value="1" required="required" name="lender_user[privacy]"/>


driver.findElement(By.xpath("//input[@id = 'lender_user_privacy']")).click();

Note: Could you suggest me the right
for clicking on the checkbox as i am getting the above error when i write the above

Answer Source

Considering the comment, to navigate back to the parent you can use xpath's parent expression /... If .//input[@id='lender_user_privacy'] is identifying you the label, that' a child of the checkbox, then you can access the checkbox using


as your xpath. However, the wait is most likely necessary considering the error that you're getting.