browser.wait_for_selector
Waits for a CSS selector to reach a specified state (visible, hidden, attached, detached) and returns once true. Prevents timing issues by raising a timeout if the condition never occurs.
Instructions
Wait for a CSS selector to reach a specific state (visible, hidden, attached, detached). Returns when the condition is met or raises on timeout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | Condition to wait for, as in Playwright's wait_for_selector. | visible |
| selector | Yes | CSS or Playwright selector. | |
| session_id | No | Target session id, from browser.create_session or browser.list_sessions. Optional when exactly one session is live; observe and act tools create one when none is. | |
| timeout_ms | No | How long to wait before failing. |