Check / Uncheck
Check / Uncheck
Section titled “Check / Uncheck”Type: page-check · Package: Browser v1.0.0
Check or uncheck a checkbox (checkbox) or radio button (radio). Unlike a direct Click, it guarantees the final state you want: if you ask to mark and it was already marked, it leaves it marked (it does not change it).
How it works
Section titled “How it works”Locates the element by its selector and takes it to the state indicated by checked: true checks it, false unchecks it. That’s why it’s more reliable than a click, which simply toggles the state.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
selector | selector | The option box or button. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
page | session | The page session. Omit it inside a body; outside, pass = page. |
checked | boolean | true = marcar (def.) · false = desmarcar. |
timeout | number | Maximum in ms to wait. By default 30000. |
Example
Section titled “Example”Page Check selector = (#aceptoTerminos) // marcar (checked = true by default)Page Check selector = (#recibirPublicidad) checked = false // desmarcarRelated activities
Section titled “Related activities”- Click — for elements that are not boxes.
- Get Attribute — check the status by reading the
checkedattribute.