Skip to content
CodeKruPro

Clear a checkbox that starts selected

Automation taskEasyAsked in: Accenture, Capgemini

A follow-up: "A checkbox is already ticked when the page opens. How do you make sure it ends unticked?" A click toggles, so the starting state decides whether you click at all.

Handle Pre-Selected Checkboxes

Handle Pre-Selected Checkboxes

Some checkboxes come pre-selected. You can verify their initial state and uncheck them.

On the Checkboxes page, checkbox id="firstSelect5" is pre-selected (checked by default).

Task:

  1. Navigate to https://testkru.com/Elements/Checkboxes
  2. Find checkbox firstSelect5
  3. Print its initial state (should be true)
  4. Click it to deselect
  5. Print its state after deselecting (should be false)

Expected output:

Initially selected: true
After deselect: false