Win Check
Win Check
Section titled “Win Check”Type: win-check · Package: Desktop Activities v1.0.8
Checks or unchecks a checkbox in a desktop application. It guarantees the final state you want, regardless of how it was before.
How it works
Section titled “How it works”It locates the control by its selector, brings its window to the front, reads its current state and only changes it when needed:
checked: leaves it checked (if it already was, it does nothing).unchecked: leaves it unchecked.toggle: inverts the current state.
That makes it idempotent: repeating it with checked or unchecked doesn’t change the result. It uses the UIA Toggle pattern; in Java applications it reads the state through the Swing bridge and, if it must change it, makes a physical click on the checkbox.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
selector | selector | — | The checkbox. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanDesktopSession | — | Win Attach session. Inside a body it is taken automatically; without a session, the selector must include the window. |
state | string | checked | Desired state: checked · unchecked · toggle (inverts). |
timeout | number | 30000 | Maximum ms to wait for the element. Empty = the project’s UI timeout or, if not set, 30000. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
The element does not support the Toggle pattern. | The control is not a checkbox for UI Automation. Standard Windows radio buttons are usually in this case: select them with Win Click. |
The element is outside the visible area and could not be scrolled into view, … | The checkbox is hidden by its container’s scrolling. Add a Win Scroll before it. |
Element not found with selector {…}. | See common errors. |
Example
Section titled “Example”Win Check selector = (checkbox "I accept the terms") // checkWin Check selector = (checkbox "Receive emails") state = unchecked // uncheckCheck it only when a value asks for it, and verify:
If condition = taxExempt └─ then: Win Check selector = (checkbox "Tax exempt")Win Get Attribute selector = (checkbox "Tax exempt") attribute = checked → output: isCheckedRelated activities
Section titled “Related activities”- Win Click — for radio buttons and controls that aren’t checkboxes.
- Win Get Attribute — read the state with
checked.