Modern QA2026Element References, Not Selectors — tiles
Log inJoin
27 / 168 · 01 Agent Skills for Browser Automation · The Playwright CLI: Browser Control for Coding Agents← prev⊞ allnext →☰ Read as one page

4.4Element References, Not Selectors

Snapshots are compact YAML accessibility summaries with stable references:

- textbox "What needs to be done?" [ref=e8]
- checkbox "Toggle Todo" [ref=e21]
- generic [ref=e22]: Write Playwright tests

The agent interacts by reference — no CSS selector authoring, no XPath debugging:

playwright-cli open https://demo.playwright.dev/todomvc/ --headed
playwright-cli snapshot
playwright-cli fill e8 "Write Playwright tests"
playwright-cli press Enter
playwright-cli check e21
playwright-cli screenshot

Each command returns a minimal response (often just a file path). Contrast this with the selector-first CLI tools of the 2025 generation — the ref model means the snapshot carries the semantics, and the agent reasons over an accessibility-tree summary rather than raw DOM.