Recall & Review
beginner
What is a radio button in web testing?
A radio button is a small circle on a web page that allows the user to select one option from a group of choices. Only one radio button in the group can be selected at a time.
Click to reveal answer
beginner
How do you locate a radio button using Selenium in Python?
You can locate a radio button using locators like
find_element(By.ID, 'id_value'), find_element(By.NAME, 'name_value'), or find_element(By.CSS_SELECTOR, 'input[type="radio"]').Click to reveal answer
beginner
How do you select a radio button using Selenium in Python?
First, locate the radio button element, then call
element.click() to select it. Selenium will simulate a user clicking the radio button.Click to reveal answer
beginner
How can you verify if a radio button is selected in Selenium Python?
Use the
element.is_selected() method. It returns True if the radio button is selected, otherwise False.Click to reveal answer
intermediate
Why should you avoid using absolute XPath for locating radio buttons?
Absolute XPath is fragile because it depends on the full path in the HTML structure. If the page layout changes, the locator breaks. Use relative XPath or other locators like ID or name for stability.
Click to reveal answer
Which Selenium method is used to check if a radio button is selected?
✗ Incorrect
The method is_selected() returns True if the radio button is selected.
What happens when you click a radio button in a group?
✗ Incorrect
Only one radio button in a group can be selected at a time. Clicking selects that one.
Which locator is best to find a radio button reliably?
✗ Incorrect
ID or Name attributes are stable and reliable locators for radio buttons.
What does the Selenium
click() method do on a radio button?✗ Incorrect
click() simulates a user clicking the radio button, selecting it.
If a radio button is not selectable, which Selenium method helps check if it is enabled?
✗ Incorrect
is_enabled() returns True if the element is enabled and can be interacted with.
Explain how to select and verify a radio button using Selenium in Python.
Think about the steps a user takes to click and check a radio button.
You got /3 concepts.
Describe best practices for locating radio buttons in Selenium tests.
Consider what makes a locator reliable and easy to maintain.
You got /3 concepts.