Add support for getComputedLabel and getComputedRole commands to WebDriver
Categories
(Remote Protocol :: Marionette, enhancement, P1)
Tracking
(firefox113 fixed)
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: automatedtester, Assigned: jdescottes)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [webdriver:m6] [webdriver:relnote])
Attachments
(2 files, 2 obsolete files)
at TPAC 2019, commands for helping with accessibility were requested.
see https://github.com/w3c/webdriver/issues/1439
Initial prose in https://github.com/w3c/webdriver/pull/1444
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
What is the best way to get a label and a role for an DOMElement from the accessibility tree. I can see that I can get the Role from nsIAccessibilityService[1] but I can't see a way of getting the label. Could you point me in the right direction here? Thanks!
[1] https://searchfox.org/mozilla-central/source/accessible/interfaces/nsIAccessibilityService.idl
Comment 2•4 years ago
|
||
You should do it like our test frameworks do, e. g. from the service, only use GetAccessibleFor, then use that instance variable's properties such as .name, .role, .description etc., to get the actual properties from the accessibility engine. See nsIAccessible.idl for methods you can use and types they return. Role, for example, is a standardized number, and the string roles are not being used much and should be avoided for the most part. Note that this needs to be privileged access to even get these accessible objects, but I assume webDriver is allowed that?
Reporter | ||
Comment 3•4 years ago
|
||
(In reply to Marco Zehe (:MarcoZ) from comment #2)
You should do it like our test frameworks do, e. g. from the service, only use GetAccessibleFor, then use that instance variable's properties such as .name, .role, .description etc., to get the actual properties from the accessibility engine.
See nsIAccessible.idl for methods you can use and types they return. Role, for example, is a standardized number, and the string roles are not being used much and should be avoided for the most part. Note that this needs to be privileged access to even get these accessible objects, but I assume webDriver is allowed that?
Yes, we have priviledged access. This is being added to marionette which has access to XPCOM APIs.
Looking at https://github.com/w3c/webdriver/issues/1439#issuecomment-533381779 I can't seem to see how I would get the label from the accessibility system. Sorry if I am overlooking it.
Comment 4•4 years ago
|
||
The label is equivalent to the name. So when you ask for the name of an accessible, you get the string the engine computed from the markup. This could be the text contents of a label element which is associated to an input via the for attribute, the inner text of a button element, the alt attribute's content of an img element, or the aria-label for any element that has that attribute. Label and Name are equivalent here. The role is what the accessibility engine made from the markup. It could be a native host language role such as entry for an input of type "text", checkbox for an input of type "checkbox", a paragraph accessible from a p element, etc.
Comment 5•4 years ago
|
||
One caveat, if you are using XPCOM accessibility API, you would want to shut down the accessibility service, otherwise, unless Firefox is restarted, it will not be shutdown (unless things get garbage collected).
Reporter | ||
Comment 6•4 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 7•9 months ago
|
||
David, are you planning to finish the work on this patch or shall we try to find someone else? Please let us know. Thanks.
Updated•8 months ago
|
Updated•4 months ago
|
Comment 10•4 months ago
|
||
FYI, the ARIA Working Group is planning to start leveraging these extensively for ARIA testing, as they are supported in both WebKit and Chromium. It will also likely be a core part of the Accessibility Investigation for InterOp 2023.
Updated•3 months ago
|
Comment 11•3 months ago
|
||
We can work on this during M7 this year which is from April - June.
Comment 12•3 months ago
|
||
Updated•3 months ago
|
Assignee | ||
Updated•3 months ago
|
Comment 13•3 months ago
|
||
The tests in comment 12 are no longer part of scoring the interop 2023 accessibility testing investigation area, see https://github.com/web-platform-tests/interop-2023-accessibility-testing/issues/3 (It would be nice to pass them, but they're not blocking.)
But these are:
https://wpt.fyi/results/wai-aria/role/basic.html?label=master&label=experimental&aligned&view=subtest
https://wpt.fyi/results/accname/basic.html?label=master&label=experimental&aligned&view=subtest
Comment 14•3 months ago
|
||
(In reply to Simon Pieters [:zcorpan] from comment #13)
The tests in comment 12 are no longer part of scoring the interop 2023 accessibility testing investigation area, see https://github.com/web-platform-tests/interop-2023-accessibility-testing/issues/3 (It would be nice to pass them, but they're not blocking.)
That is totally fine given that those are basically unit tests for the different WebDriver implementations to actually make sure the implementation is correct.
Assignee | ||
Comment 15•3 months ago
|
||
A base getAccessible helper is extracted from the accessibility.Checks module to avoid issues related to the "strict" flag, which do not make sense here.
Assignee | ||
Comment 16•3 months ago
|
||
Depends on D172146
Assignee | ||
Comment 17•3 months ago
|
||
Depends on D172155
Comment 18•3 months ago
|
||
Comment on attachment 9322183 [details]
Bug 1585622 - [marionette-client] Sort marionette-client unit-tests.ini alphabetically
Revision D172156 was moved to bug 1818173. Setting attachment 9322183 [details] to obsolete.
Assignee | ||
Comment 19•3 months ago
|
||
Reducing to 2 points since the marionette client changes were split to another bug.
Comment 20•3 months ago
|
||
Comment on attachment 9322177 [details]
Bug 1585622 - [marionette-client] Add marionette-client tests for getComputedLabel and getComputedRole
Revision D172155 was moved to bug 1821677. Setting attachment 9322177 [details] to obsolete.
Comment 21•3 months ago
|
||
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8f206c77ab7 [marionette] Add support for getComputedRole and getComputedLabel r=webdriver-reviewers,whimboo
Comment 22•3 months ago
|
||
bugherder |
Assignee | ||
Updated•1 month ago
|
Description
•