wait_for
Wait for UI elements to appear or disappear on any desktop app, with flexible timeout and multi-query support. Polls until conditions are met or time runs out.
Instructions
Wait for elements to appear or disappear.
Polls until matching elements are found (or gone) or timeout.
Use after actions that trigger UI changes.
Args:
element: Text to search for. Pass a single string (e.g.
"Submit") or a list of strings (e.g. ["Success", "Error"])
for multi-query mode. With mode="any", returns as soon
as any query matches. With mode="all", waits until every
query has matched.
app: Scope to this application.
window_id: Scope to this window.
role: Only match this role.
states: Only match elements with ALL these states.
fields: Which fields to search (default: ["name"]).
mode: "any" (return when any query matches) or "all"
(wait for all queries to match). Only meaningful when
element is a list.
timeout: Maximum seconds to wait (default 10).
source: "full" (default), "cdp_ax", "native", or "dom".
"ax" remains as a compatibility alias for "cdp_ax".
max_results: Maximum elements to return (default 5).
wait_for_new: If true, ignore elements already present -- wait for NEW ones.
gone: If true, wait for matching elements to DISAPPEAR instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| element | Yes | ||
| app | No | ||
| window_id | No | ||
| role | No | ||
| states | No | ||
| fields | No | ||
| mode | No | any | |
| timeout | No | ||
| source | No | full | |
| max_results | No | ||
| wait_for_new | No | ||
| gone | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |