close

[Solved] ElementClickInterceptedException: Message: element click intercepted Element is not clickable error clicking a radio button using Selenium and Python

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ElementClickInterceptedException: Message: element click intercepted Element is not clickable error clicking a radio button using Selenium and Python in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ElementClickInterceptedException: Message: element click intercepted Element is not clickable error clicking a radio button using Selenium and Python Error Occurs?

Today I get the following error ElementClickInterceptedException: Message: element click intercepted Element is not clickable error clicking a radio button using Selenium and Python in Python.

How To Solve ElementClickInterceptedException: Message: element click intercepted Element is not clickable error clicking a radio button using Selenium and Python Error ?

  1. How To Solve ElementClickInterceptedException: Message: element click intercepted Element is not clickable error clicking a radio button using Selenium and Python Error ?

    To Solve ElementClickInterceptedException: Message: element click intercepted Element is not clickable error clicking a radio button using Selenium and Python Error The desired element is a Angular element so to invoke click() on the element you have to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following Locator Strategies:

Solution 1

This error message…

selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: 
Element <input type="radio" name="docTypes" ng-model="$ctrl.documentTypes.selected" id="documentType-0" ng-change="$ctrl.onChangeDocumentType()" ng-value="documentType" tabindex="0" class="ng-pristine ng-untouched ng-valid ng-empty" value="[object Object]" aria-invalid="false"> 
is not clickable at point (338, 202). 
Other element would receive the click:
 <label translate-attr="{title: 'fulfillment.documentAction.createNew.modal.documentType.document.title'}" translate-values="{documentName: documentType.name}" for="documentType-0" translate="ASN - DSD" tabindex="0" title="Select ASN - DSD document type">...</label>

…implies that the desired element wasn’t clickable as some other element obscures it.


The desired element is a Angular element so to invoke click() on the element you have to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following Locator Strategies:

  • Using CSS_SELECTOR:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "label[for='documentType-0']"))).click()
  • Using XPATH:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//label[@for='documentType-0']"))).click()
  • Note : You have to add the following imports :from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC

Update

As an alternative you can use the execute_script() method as follows:

  • Using CSS_SELECTOR:driver.execute_script("arguments[0].click();", WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "label[for='documentType-0']"))))
  • Using XPATH:driver.execute_script("arguments[0].click();", WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//label[@for='documentType-0']"))))

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment