wait
Wait for a DOM element to become visible, hidden, or attached, or pause for a set duration. Returns page state after async changes complete.
Instructions
Wait for a DOM element to reach a specified state (visible, hidden, attached, detached) or pause for a fixed duration. Use after actions that trigger asynchronous page changes such as form submissions, AJAX requests, or animations. Returns post-action page_state showing the resulting URL, title, and structural diff once the condition is met or the timeout expires, unless silent: true is set for a time-only wait, in which case only the completion signal is returned.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | Target state to wait for. 'attached' (default) = element exists in DOM; 'visible' = element is rendered and not hidden; 'hidden' = element is no longer visible; 'detached' = element removed from DOM. Use 'hidden' to wait for loading spinners to disappear. | |
| silent | No | When true, suppress the page_state payload from the response. Use for simple timed pauses where you don't need a structural diff — saves context tokens. Only effective for time-only waits (no selector). Default: false. | |
| seconds | No | Fixed number of seconds to wait (max 300). Use when no specific element signals completion. Mutually exclusive with 'selector'. | |
| selector | No | CSS selector of the element to wait for (e.g. ".results-loaded", "#spinner"). Mutually exclusive with 'seconds' — provide one or the other. |