Skip to content

[Feature]: Support for ref options in aria_snapshot (API parity with Node.js) #2826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
argszero opened this issue Apr 28, 2025 · 1 comment
Closed

Comments

@argszero
Copy link

🚀 Feature Request

Title: Feature Request: Support for ref options in aria_snapshot (API parity with Node.js)

Request:

  • Please consider adding support for the ref option (and any other relevant options) to the aria_snapshot method in Playwright for Python, to achieve API parity with the Node.js version.
  • Alternatively, please update the documentation to clarify the differences and current limitations between the Node.js and Python APIs for ARIA snapshotting.

Thank you

Example

Description:

In Playwright for Node.js, it is possible to use the following code to obtain an ARIA snapshot with additional options:

await page.locator('body').ariaSnapshot({ ref: true});

However, when attempting to use similar options in Playwright for Python:

snapshot = await page.locator("body").aria_snapshot(ref=True)

I receive the following error:

TypeError: Locator.aria_snapshot() got an unexpected keyword argument 'ref'

Motivation

Motivation:

  • Consistent APIs across Playwright languages make it easier for users to migrate code and share knowledge.
  • The additional options are useful for advanced accessibility testing and automation.
@mxschmitt
Copy link
Member

Will be part of #2823 and v1.52.0. Folding into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants