webview_inspect
Resolves a CSS selector to DOM elements with absolute on-screen tap coordinates in embedded WebViews on a booted simulator. Enables precise UI automation by providing tapX/tapY from real DOM elements.
Instructions
Lists embedded WebViews (WKWebView) on a booted simulator and, for the selected one, resolves a CSS selector to DOM elements WITH absolute on-screen tap coordinates. This is the answer to the 'WebView content is opaque' limitation of the coordinate tools: instead of eyeballing a screenshot, get tapX/tapY for a real DOM element and feed it straight into tap_on. Defaults to interactive elements when no selector is given. Requires the app's WKWebView to be inspectable (isInspectable=true) — on by default in debug/staging builds, frequently disabled in production App Store builds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Simulator / device UDID (from device_list) | |
| selector | No | CSS selector (default: 'button, a, input, textarea, [role=button]') | |
| webviewId | No | Target WebView id (from a prior call). Omit to auto-select the first visible WebView. | |
| max | No | Maximum elements to return (default 100) |