Skip to content

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.

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.
ParameterTypeDefaultDescription
selectorselector—The element to wait for.
ParameterTypeDefaultDescription
sessionZoanDesktopSession—Win Attach session. Inside a body it is taken automatically; without a session, the selector must include the window.
statestringvisibleExpected state: visible (appear) · hidden (disappear).
timeoutnumber30000Maximum ms to wait. Empty = the project’s UI timeout or, if not set, 30000.

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.

MessageCause 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.

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 finish
Win Wait For selector = (table "Results") state = visible // and for the result
Win Extract Table selector = (table "Results") → output: results