The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Find the intended radio input with a stable locator, wait until it is ready, click it, and verify the selection with Selenium’s selected-state method. In Python, that method is is_selected(); its casing differs in other Selenium language bindings.
Locate the exact radio option
Inspect the page’s markup and identify attributes that distinguish both the group and the option, such as id, name, and value. A selector for a specific option might look like input[name="plan"][value="premium"]; use it only if those attributes match the actual page.
As an Amazon Associate I earn from qualifying purchases.
Prefer a unique, stable ID when one exists. Otherwise, a concise CSS selector is often easy to read and maintain. XPath is useful when it makes a relationship or attribute match clearer, but avoid long absolute paths and selectors tied to incidental page structure. Selenium supports locator strategies including ID, name, CSS selector, and XPath; see the official locator guide and its locator practices.
Select and verify the radio button in Python
This example waits for the target radio to become clickable, clicks it, and checks that it is selected. Replace the locator with attributes from your page.
#1 Best Overall
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
radio = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.CSS_SELECTOR, 'input[name="plan"][value="premium"]'))
)
radio.click()
assert radio.is_selected()
The snippet assumes driver is an initialized WebDriver session and the page is already open. Selenium’s Python WebElement API documents is_selected() for checking selected state, including radio buttons; other bindings use their own method casing. See the Python WebElement API.
Understand radio groups and labels
Radio buttons represent a single choice from a set, unlike checkboxes, which allow independent choices. Inputs with the same name belong to a group; selecting one changes the selected option in that group. A radio may already be selected when the page loads, so assert the intended final state instead of assuming that every click caused a change.
Rank #2
You can also click the associated <label>. This can be practical when the input is visually small, provided you target the label associated with the option you intend to choose. The browser’s radio-control behavior and label association are described in MDN’s radio input reference.
Wait for dynamic controls before clicking
Navigation completing does not guarantee that a JavaScript-rendered radio has been inserted, displayed, or made interactable. Use an explicit wait for the condition needed at that step—such as locating the element or waiting until it is clickable—then click and verify the selected state.
Rank #3
Selenium warns, “Do not mix implicit and explicit waits.” Mixing them can make total wait durations unpredictable. Prefer a consistent synchronization strategy, usually explicit waits for the specific page state required. Fixed sleeps do not adapt to page speed: they may end too early or waste time when the control is ready sooner. See Selenium’s waiting strategies.
Troubleshoot selection failures
- The wrong option is selected: make the locator specific to both the group and option, and confirm it matches the page’s actual attributes. Avoid selecting the first radio found if the page contains multiple groups.
- No element is found: check the selector against the rendered page, and wait for JavaScript-driven content when necessary.
- The click fails or is intercepted: confirm the element is displayed and enabled, and check for an overlay or other element covering it. Clicking the associated label may help when that is the page’s intended visible target.
- The assertion fails: verify that the click targeted the intended option and that the assertion runs after the interaction. Remember that a radio may have been selected already or another same-named option may be selected instead.
- Wait timing is erratic: avoid combining implicit and explicit waits. Wait for the relevant condition rather than adding an arbitrary long sleep.
Or skip the browser setup
If you need a screenshot of the page rather than a Selenium interaction test, ScreenshotNeo can return a screenshot or PDF from one API request. For example, this cURL request captures a page as WebP:
Rank #4
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for free.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Frequently Asked Questions
Does clicking a radio button toggle it off?
No. Radio controls select one option in their group; selecting another option changes the group’s selected value.
Which Selenium method checks whether a radio is selected?
Use the selected-state API for your language binding; in Python, call `is_selected()`.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




