2

I am working in Python 3 and using Selenium to click on a radio button in a browser. I am able to locate the Radio Element to be clicked. However, when I do Element.click(), it gives me an error:

Message: unknown error: Element <Description of Element> is not clickable at point (340, 190).

Other element would receive the click: <Description of some other element>.  

The radio element, as it appears in browser is:

<input data-val="true" data-val-required="Required" id="Promoter" name="Type" onchange="Checkboxck(&#39;Promoter&#39;)" type="radio" value="Promoter" />

My code to find this radio element and click on it is:

Registered_Project_RadioButton = browser.find_element_by_id("Promoter")
Registered_Project_RadioButton.click()
glhr
  • 4,439
  • 1
  • 15
  • 26
  • You need to either dismiss the other element or wait until it's gone, e.g. a Loading... popup, floating header, dialog, etc. – JeffC Apr 22 '19 at 21:35

1 Answers1

0

Use Actions Class or Java Script Executor to achieve this.

from selenium.webdriver.common.action_chains import ActionChains

Registered_Project_RadioButton = browser.find_element_by_id("Promoter")
ActionChains(browser).move_to_element(Registered_Project_RadioButton).click().perform()

OR

Registered_Project_RadioButton = browser.find_element_by_id("Promoter")
browser.execute_script("arguments[0].click();", Registered_Project_RadioButton)
KunduK
  • 32,888
  • 5
  • 17
  • 41