Last active
March 11, 2025 10:29
-
-
Save adamliptrot-oc/ae2c27fb0461766396cfd1b112af42a0 to your computer and use it in GitHub Desktop.
Use accessible attributes in selectors with Playwright
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // get button with accessible name of "login" and aria-expanded=false | |
| await page.getByRole('button', {name: "login", expanded: false}); | |
| // get h2 with accessible name of "conditions" | |
| await page.getByRole('heading', {level: 2, name: "Conditions"}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment