Skip to content Skip to sidebar Skip to footer

Click Radio Button Coupled To A Label With Same Name Using Firefox Webdriver

I'm using Selenium 3.12.0 with Python 3.7.2 and Firefox 66.0.1 on Fedora 29. I'm having trouble clicking a radio button. The radio button is inside a label, and the radio and label

Solution 1:

Please check radio status using is_selected:

radio_robocall = driver.find_element_by_name("PrerecMsg")
# is_selected should return False
print(f"radio_robocall status: {str(radio_robocall.is_selected())}")

radio_robocall.click()
# is_selected should return True
print(f"radio_robocall status: {str(radio_robocall.is_selected())}")

Post a Comment for "Click Radio Button Coupled To A Label With Same Name Using Firefox Webdriver"