wait_for
Wait for an element or text to reach a specified state (present, visible, not_visible, absent) on dynamic pages. Synchronize automation by pausing until the condition is met, with a configurable timeout.
Instructions
Wait until an element or text reaches a requested state.
Use this tool when the page is dynamic and an automation step must wait for a condition before continuing.
Unlike check_for_condition, this tool intentionally waits. Unlike assert_condition, its purpose is synchronization rather than validating a test expectation.
Args: state: - "present": Wait until the matching element exists. - "visible": Wait until the matching element is visible. - "not_visible": Wait until the matching element is not visible. - "absent": Wait until the matching element no longer exists. Ignored when text is provided. selector: CSS selector or SeleniumBase selector for the element. Required unless text is supplied. text: If supplied, wait for this text to appear within selector (or within "body" when selector is omitted). timeout: Maximum seconds to wait. Defaults to 7 seconds.
Returns: A confirmation when the requested condition is reached.
Tool selection: - Check current state immediately -> use check_for_condition. - Wait for a state/content transition -> use wait_for. - Verify an expected value/condition -> use assert_condition.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| state | No | visible | |
| timeout | No | ||
| selector | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |