Skip to content

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

Closed
@argszero

Description

@argszero

🚀 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.

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