Wait for text
wait_forWait until one of several texts appears on the page, then capture a snapshot. Polls visible text twice per second, returning immediately when a match is found, with the snapshot included.
Instructions
Wait until one of several texts appears on the page, then snapshot it.
The right way to wait after an action that starts loading — far more reliable than guessing a delay, and it returns the moment the text shows up instead of always burning the whole timeout.
On success the page snapshot is included in the response, so no separate take_snapshot call is needed.
Polls the visible text twice a second. To wait for an element rather than for wording, use wait_for_selector.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Texts to wait for — the wait ends as soon as any one of them appears. Passing both outcomes, e.g. ["Welcome back", "Login failed"], lets one call tell you which happened. Matching is a case-sensitive substring test against the page's visible text. | |
| timeout | No | Maximum wait in milliseconds before giving up. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |