Skip to content
CodeKruPro

Choose one radio button in a group

Automation taskEasyAsked in: Accenture, Capgemini

"How do radio buttons differ from checkboxes in a test?" Radio buttons with the same name form a group, and choosing one clears the others. Click two in turn and check both states after each click.

Handle Radio Buttons

Handle Radio Buttons

Radio buttons work similarly to checkboxes, but only one can be selected at a time within a group (same name).

On the Radio Buttons page, the single-select group has radio buttons with name="select".

HTML Structure (radio group):

<!-- All radios with the same name form a group -->
<input type="radio" id="firstSelect1" name="select" value="firstSelect1">
<label for="firstSelect1">First Select</label>

<input type="radio" id="secondSelect1" name="select" value="secondSelect1">
<label for="secondSelect1">Second Select</label>

<input type="radio" id="thirdSelect1" name="select" value="thirdSelect1">
<label for="thirdSelect1">Third Select</label>

Task:

  1. Navigate to https://testkru.com/Elements/RadioButtons
  2. Check if firstSelect1 is selected (should be false)
  3. Click firstSelect1 to select it
  4. Check if firstSelect1 is now selected (should be true)
  5. Click secondSelect1 (same group) and check both states

Expected output:

First initially: false
First after click: true
After selecting second - First: false
After selecting second - Second: true