glass_wait_for_element
Blocks execution until a UI element reaches a specified state (e.g., appears, enabled, hidden) and returns the element's accessible details for further automation.
Instructions
Block until a UI element reaches a precise state, then return it as text (no image). Select by name (accessible-name substring) and/or role (e.g. "Button"); condition (default appears): appears|disappears|enabled|disabled|checked|unchecked|selected|unselected|expanded|collapsed|focused|visible|hidden; optional value_contains. Returns {matched,elapsed_ms,element{id,role,name,bounds,states}} — the id is usable with glass_click_element. On timeout returns {matched:false}. Waits through a just-launched app that has not published its accessibility tree yet, and errors if none appeared before the timeout. Collapses screenshot poll-loops into one call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Substring of the element's accessible name (selector). | |
| role | No | Element role filter, e.g. "Button", "ProgressBar" (selector). | |
| condition | No | What to wait for (default "appears"): appears|disappears|enabled|disabled| checked|unchecked|selected|unselected|expanded|collapsed|focused|visible|hidden. `checked`/`unchecked` only match a checkable element (one exposing a real toggle state) — a non-toggle element matches neither. | |
| timeout_ms | No | Give up after this long (default 10000ms); returns `{matched:false}`. | |
| interval_ms | No | Poll interval (default 200ms — an a11y snapshot per tick). | |
| value_contains | No | Additionally require the matched element's `value` to contain this substring. Not a standalone selector — `name` and/or `role` is still required. |