Selecting elements using Accessible Names #18689
crunchy-vonage
started this conversation in
General
Replies: 1 comment
-
I also want to have this feature |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I'm interested in using accessibility names to find elements instead of CSS Selectors.
The accessible names of objects are very important for disabled access (screen readers), they tend to better looked after than automation IDs and have clever defaults if absent. There is also the social benefit of encouraging good accessibility of sites motivated by use of test automation.
Puppeteer folks have added support via devtools protocol:-
But there is a big push on browser accessibility recently (following webcomponents braking the existing model) and w3c are pushing a number of new API's to set the accessibility properties and access the result.
https://wicg.github.io/aom/caniuse.html
Support is coming to all major browsers but I have been playing with chrome with the following flag"--enable-blink-features=AccessibilityObjectModel".
This exposes window.getComputedAccessibleNode(el) which can be used to get the elements accessibly role and name.
Questions:-
Thanks Matt
Beta Was this translation helpful? Give feedback.
All reactions