Win Wait For
Win Wait For
Section titled “Win Wait For”Type: win-wait-for · Package: Desktop Activities v1.0.8 · Output: boolean
Pauses the flow until an element appears (visible) or disappears (hidden). It’s the essential tool to make desktop automations reliable: instead of guessing with a fixed Delay how long a window or control takes to load, you wait exactly until it is ready.
How it works
Section titled “How it works”It searches for the element given by the selector every 250 ms until it reaches the requested state. As soon as it does, the flow continues; if timeout runs out, the activity fails.
visible: waits until the element can be located.hidden: waits until it can no longer be located. If it is already gone at the start, it continues immediately.- It doesn’t interact with the application or bring it to the front.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
selector | selector | — | The element to wait for. |
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 | visible | Expected state: visible (appear) · hidden (disappear). |
timeout | number | 30000 | Maximum ms to wait. Empty = the project’s UI timeout or, if not set, 30000. |
Output
Section titled “Output”Returns a boolean: always true when the element reaches the expected state. If it doesn’t, the activity fails (it doesn’t return false); for a check that doesn’t fail, use Win Element Exists.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Timed out waiting for the element to appear. | The element didn’t appear within timeout. Raise timeout if the application is slow, or check the selector in UI Discover. |
Timed out waiting for the element to disappear. | The element was still there when timeout ran out (a “Loading…” that never ends). Check the application or raise timeout. |
'selector' is required. | The selector is missing or invalid. |
Example
Section titled “Example”Wait for a “Loading…” message to disappear and for the result to appear:
Win Click selector = (button "Search")Win Wait For selector = (label "Loading...") state = hidden // wait for it to finishWin Wait For selector = (table "Results") state = visible // and for the resultWin Extract Table selector = (table "Results") → output: resultsRelated activities
Section titled “Related activities”- Win Element Exists — check presence without failing (true/false).
- Win Get Attribute — query
enabledand other states.