Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Drive a browser from the terminal with Playwright snapshots, refs, and direct page actions.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/element-attributes.md
1# Inspecting Element Attributes23When the snapshot doesn't show an element's `id`, `class`, `data-*` attributes, or other DOM properties, use `eval` to inspect them.45## Examples67```bash8playwright-cli snapshot9# snapshot shows a button as e7 but doesn't reveal its id or data attributes1011# get the element's id12playwright-cli eval "el => el.id" e71314# get all CSS classes15playwright-cli eval "el => el.className" e71617# get a specific attribute18playwright-cli eval "el => el.getAttribute('data-testid')" e719playwright-cli eval "el => el.getAttribute('aria-label')" e72021# get a computed style property22playwright-cli eval "el => getComputedStyle(el).display" e723```24