0

I use selenium with python and want to mark a checkbox by clicking on it. After having identified the <input> tag of the checkbox with selenium, I attempt to click on it with

checkbox.click()

However, it throws the ElementClickInterceptedException.

I identify the checkbox I want to click on through a loop. When I try to click on the checkbox outside of the loop (by manually running the code after it was identified and saved to a variable), I found two things:

  • All things equal, I still get the exception
  • When I click in the browser window once (that was opened with selenium) and then run checkbox.click(), it works as expected

Any ideas why and how I could attempt to slove this issue (i.e. being able to click on the checkbox within the loop)?

Thanks!

2 Answers 2

2

You either deal with the overlapping element or use javascript

driver.execute_script("arguments[0].click();", checkbox)
Sign up to request clarification or add additional context in comments.

Comments

1

Sometimes, the checkbox is not directly interactable. You may have to click on the label/text next to the checkbox.

or May be you have to wait till the element is clickable since your are running in a loop.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.