wait_for
Pause until text appears, a CSS selector becomes visible, or the URL contains a substring, then continue. Replaces guessed delays after clicks that load content asynchronously.
Instructions
Read-only: pause until a condition holds, polling every 200 ms: given text appears in the page, a CSS selector becomes visible, or the URL contains a substring; gone=true waits for the opposite. Returns how long it waited, or an error on timeout. Use it after clicks that load content asynchronously instead of guessing delays. With only ms it just sleeps (up to 60000). Give exactly one of text, selector or url.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ms | No | Plain sleep in milliseconds (max 60000); only used when no text, selector or url is given. | |
| tab | No | Tab id from tabs_list. Defaults to the current tab. | |
| url | No | Substring the tab URL should contain. | |
| gone | No | Wait for the condition to become false instead, e.g. for a spinner to disappear. | |
| text | No | Text that should appear somewhere in the page body. | |
| selector | No | CSS selector of an element that should become visible. | |
| timeout_ms | No | Give up and return an error after this many milliseconds (default 10000). |