'Selenium: How to click a label

I'm trying to click this object with selenium (pyhton) using the code:

driver.find_element_by_('publicForm_customFields').click()

But I'm receiving this error:

id="publicForm_customFields" tabindex="0" type="radio" value="value"> is not clickable at point (480, 98). Other element would receive the click: value



Solution 1:[1]

There might be two possibilities:

1- Your locator to find element might be wrong or not unique. 2- You need to apply explicit wait till element is ready [load successfully] to be clickable.

Hope above possibilities might help you out, Or you share the link of the sight so I might debug correctly.

Solution 2:[2]

You are not passing any find method to the driver. Try refactoring the code to:

driver.find_element_by_id('publicForm_customFields').click()

Also, try using some sort of wait so the driver does not click before the page/element is loaded.


from selenium.webdriver.support import expected_conditions as EC

wait = WebDriverWait(driver, 10)
wait.until(EC.element_to_be_clickable((By.ID, 'publicForm_customFields'))).click()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Muhammad Farooq
Solution 2 Funky Monkey