wait
Wait for a DOM element to become visible, hidden, attached, or detached, or pause for a fixed duration. Use after triggers like form submissions or AJAX requests to capture the resulting page state.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | |
| 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. |