ui_check
Set checkboxes or radios to a specified state, avoiding blind toggles. Reads the current state first and clicks only when it differs, so repeated calls do not undo changes.
Instructions
Set a checkbox or radio to a specific state, rather than toggling it blindly. Reads the current state first and clicks only if it differs, so calling it twice does not undo the first call — the usual way a 'toggle' helper leaves a form in the wrong state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nth | No | Which match to use when several qualify, 0-based. | |
| role | No | Narrow the matches to this ARIA role. | |
| text | No | Visible text on the control. Matches the innermost element that carries it, and follows a <label> to its input. | |
| exact | No | Require the whole text to match rather than a substring. | |
| frame | No | 'main' (default) or a substring of a frame's origin/name. Single-page apps often render the screen you want in a child frame. | main |
| testid | No | Value of a test attribute (data-testid and friends — see the testAttributes setting). | |
| checked | No | The state you want. | |
| selector | No | CSS selector. Descends into open shadow roots. | |
| timeout_ms | No | How long to wait for the element to become actionable before giving up. |