webpage_wait_for
Poll for an element to appear (and optionally become visible) in the device browser by CSS selector — works on BOTH iOS Safari and Android Chrome. Polls every 250ms inside a single CDP session (no reconnect per tick) until found or timeoutMs elapses. Returns { found, waitedMs } rather than throwing on timeout, so callers can branch on the result. When the selector matches several elements, ANY of them satisfying the test counts as found — so a control duplicated across responsive breakpoints is reported visible when the on-screen copy is.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Device UDID / serial (iOS or Android) | |
| pageId | No | Target page/tab id — auto-picked when omitted | |
| socket | No | Android only: abstract unix socket name (default: chrome_devtools_remote) | |
| visible | No | Also require the element to be visible (has client rects and a laid-out offsetParent, or position:fixed) rather than merely present in the DOM (default: false) | |
| selector | Yes | CSS selector to wait for | |
| timeoutMs | No | Max time to wait in milliseconds (default: 5000, max: 30000) | |
| platformVersion | No | Ignored (kept for compatibility) |