android_devtools_elements
Extract locator-friendly element data from a page on the device for building Playwright/Selenium locators. For each element (interactive/meaningful elements by default, or those matching selector) returns: tag, trimmed text, key attributes (id/name/type/role/aria-label/placeholder/href/value/data-testid + any data-*), classes, bounding box {x,y,w,h} and a visibility flag. USE suggested — the locator worth writing (id, then test-id, name, aria-label, placeholder), each verified unique before it is offered, with playwright giving the same target in getByRole/getByTestId form. css and xpath are diagnostic fallbacks, not recommendations: the CSS path is an nth-of-type chain over layout classes and does not belong in a page object. When suggested is null nothing stable exists — act via ref and treat the missing test-id as the real finding. Set includeStyles=true to also return a curated set of computed styles per element. Omit pageId to auto-select the visible/active page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Device serial number (UDID) | |
| limit | No | Max elements to return (default 150) | |
| pageId | No | Target page id (auto-picked when omitted) | |
| socket | No | Abstract unix socket name (default: chrome_devtools_remote) | |
| selector | No | CSS selector to scope extraction (default: interactive/meaningful elements) | |
| includeStyles | No | Include a curated set of computed styles per element (default false) |