J
J
j3rryz0r2020-08-21 16:06:47
Python
j3rryz0r, 2020-08-21 16:06:47

Clicking on Selenium Webdriver/Python checkbox results in an error?

Task: you need to click Selenium Webdriver on the checkbox so that a bar appears there.

<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="save-info" required="">
<label class="custom-control-label" for="save-info">
::before
"Agree with"
<a href="https://www.terms.com/"> terms and conditions</a>
::after
 </label>
<div class="Toastify"></div>
</div>


Xpath for input type="checkbox" is //*[@id="save-info"]

Accordingly, to check the box, you need: driver.find_element_by_xpath("//input[@id='save-info']"). click() well, I think so :)

But an error pops up: selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (327, 352). Other element would receive the click: ...

I've already tried everything possible, from css selectors to full path , nothing helps.. I can't figure out where this click goes.
Thanks in advance for your replies

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
j3rryz0r, 2020-08-24
@j3rryz0r

Problem solved:

element = driver.find_element_by_id('save-info')
driver.execute_script("arguments[0].click();", element)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question