Wait For Selector
wait_for_selectorPoll until an element appears, becomes visible, or disappears after a click loads content. Returns explicit counts on timeout and fails fast on broken selectors or page errors.
Instructions
Poll until an element appears, becomes visible, or disappears. Use after a click that loads content. On timeout it says so explicitly with waitedMs and the last counts, and a broken selector or page error fails straight away instead of burning the whole timeout. The visible state ignores screen-reader clipping (boxes under 2x2 px, inset clip-path), which nothing can actually click.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exact | No | For "text=", "label=" and "placeholder=" selectors, require the whole trimmed text to equal the label instead of containing it. No effect on CSS, ref= or role= selectors. | |
| state | No | Condition to wait for. A ref that is gone counts as absent. | visible |
| tab_id | No | Arc tab id from list_tabs. Omit to use this agent's current tab. A tool that changes a tab will not fall back to the tab the user is looking at, so pass this or call open_url first. | |
| verbose | No | Include the bulky element rect and longer attribute values | |
| selector | Yes | CSS selector, or one of: "text=Some label" (visible text, case-insensitive substring, exact matches ranked first); "ref=e12" (a ref from snapshot, re-resolved if the page re-rendered); "role=button[name="Save"]" (ARIA or implicit role, name an exact match, or name~="sav" for a substring); "label=Email" (the control a label names); "placeholder=Search" | |
| timeout_ms | No | Give up after this long. Every call returns the current counts, so repeated short waits tell you more than one long one. Capped at 30000ms so the call cannot outlive a client's request timeout. To wait longer, call this again. |