locator.getAttribute
locator.getAttribute is a browser runtime capability in the locator namespace.
Availability
- Runtime:
browser - Kind:
raw - Category:
extraction - Supported drivers: Playwright, Puppeteer
SDK Surface
- SDK path:
runtime.page.locator(...).getAttribute - Async: Yes
HTTP Surface
- Transport:
workspace.execute(...) - Call:
locator.getAttribute - Long-running: No
Reference Semantics
- Requires refs:
locator
Arguments
Result
- Type:
string | null - Description: Attribute value if present.

