glass_wait_for_element
Block until an accessible element reaches a condition such as appears or enabled, optionally with a value, then return it. Verifies semantic UI state instead of screenshots.
Instructions
Wait for semantic transition completion: block until an accessible element reaches a condition and optional value, then return it as text (no image). This verifies runtime semantic state, not pixels or visual stability. Select by name (accessible-name substring), description (accessible-description substring) and/or role (e.g. "Button"); condition (default appears): appears|disappears|enabled|disabled|checked|unchecked|selected|unselected|expanded|collapsed|focused|visible|hidden; value additionally requires an exact editable value, while value_contains requires a substring (combine either with a selector). Returns {matched,elapsed_ms} plus the matched element, including value — its 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. If at least two next actions or waits are known, use glass_do instead of separate calls.
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", "Document" (selector). | |
| value | No | Exact case-sensitive accessible value, requiring another selector and excluding `value_contains`. | |
| 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}`. | |
| description | No | Substring of the element's accessible description (selector). Useful for unnamed controls whose platform label is exposed as a hint, help text, or description. | |
| 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`, `description`, and/or `role` is still required. |