Skip to content

pw snapshot does not resolve ref selectors (e.g., e1541) as pw click does #347

@binkybarnes

Description

@binkybarnes

Describe the bug

Using a ref (e.g., e1541) with pw snapshot produces an error, while the same ref works with pw click.

Command/output:

pw snapshot e1541
### Error
Error: Selector "e1541" does not match any element

But with pw click:

pw click e1541
### Ran Playwright code
await page.getByRole('link', { name: 'Privacy' }).click();
### Page
- Page URL: https://policies.google.com/privacy?hl=en&fg=1
- Page Title: Privacy Policy – Privacy & Terms – Google
### Snapshot
- [Snapshot](.playwright-cli/page-2026-04-07T02-30-30-330Z.yml)
### Events
- New console entries: .playwright-cli/console-2026-04-07T02-16-05-315Z.log#L20-L22

Expected behavior

  • The pw snapshot command should resolve refs (e.g., e1541) just like pw click does, or error messages should clarify that refs are not supported for snapshot.

Additional context

See above for reproduction steps, page state, and logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions