Of the 7 Accessibility methods, browser sessions serve 0, phone sessions 7 and computer sessions 2. A method marked not served answers StrategyUnavailable on that kind of session; check the handshake’s capabilities before relying on one.
A phone’s handshake lists the Accessibility methods only while the phone has an accessibility tree to serve. Without one they are left out of capabilities and answer StrategyUnavailable.
A computer serves getFullAXTree and queryAXTree on its desktop: the UI Automation tree of every native app’s windows. A browser page’s tree is read with Page.ariaSnapshot.
Accessibility.enable
Browser: not served
Phone: served when it has a tree
Computer: not served
Takes targetId
Turn the session’s accessibility tree on. Returns once the session confirms it is on. Advertised only where the tree can be toggled.
{"id": 1, "method": "Accessibility.enable", "params": {}}
| Param | Type | Required | Description |
|---|
idempotencyKey | string | No | Makes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys. |
Result: an empty object {}.
Accessibility.disable
Browser: not served
Phone: served when it has a tree
Computer: not served
Takes targetId
Turn the session’s accessibility tree off. Returns once the session confirms it is off. Locators then resolve by vision.
{"id": 1, "method": "Accessibility.disable", "params": {}}
| Param | Type | Required | Description |
|---|
idempotencyKey | string | No | Makes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys. |
Result: an empty object {}.
Accessibility.getState
Browser: not served
Phone: served when it has a tree
Computer: not served
Takes targetId
Whether the tree is on, and whether this session can toggle it.
{"id": 1, "method": "Accessibility.getState", "params": {}}
No params.
Result
| Field | Type | Description |
|---|
enabled | boolean | The tree is on. |
toggleable | boolean | This session can turn it on and off. |
Accessibility.getFullAXTree
Browser: not served
Phone: served when it has a tree
Computer: served
Takes targetId
The accessibility tree of every window (or one), in document order. Fails with StrategyUnavailable while the tree is off.
{"id": 1, "method": "Accessibility.getFullAXTree", "params": {}}
| Param | Type | Required | Description |
|---|
depth | integer | No | How far below each window root to go; 0 is the roots only. Omitted means the whole tree. From 0 to 2147483647. |
windowId | string | No | Only this window. Omitted means every window. |
interestingOnly | boolean | No | Drop layout-only nodes (CDP’s ignored semantics). Default true. |
Result
| Field | Type | Description |
|---|
nodes | AXNode[] | |
windows | AXWindow[] | |
capturedAt | integer | Epoch-ms. |
Accessibility.getPartialAXTree
Browser: not served
Phone: served when it has a tree
Computer: not served
Takes targetId
One node, with its ancestors, siblings and children unless fetchRelatives is false. Fails with StaleNode when the node is gone.
{"id": 1, "method": "Accessibility.getPartialAXTree", "params": {"nodeId": "<nodeId>"}}
| Param | Type | Required | Description |
|---|
nodeId | string | Yes | Opaque node id from a snapshot. |
fetchRelatives | boolean | No | Include the node’s ancestors, siblings and children. Default true. |
Result
| Field | Type | Description |
|---|
nodes | AXNode[] | |
Accessibility.getChildAXNodes
Browser: not served
Phone: served when it has a tree
Computer: not served
Takes targetId
A node’s children. Fails with StaleNode when the node is gone.
{"id": 1, "method": "Accessibility.getChildAXNodes", "params": {"id": "<id>"}}
| Param | Type | Required | Description |
|---|
id | string | Yes | The parent node’s id. |
Result
| Field | Type | Description |
|---|
nodes | AXNode[] | |
Accessibility.queryAXTree
Browser: not served
Phone: served when it has a tree
Computer: served
Takes targetId
Every visible node matching accessibleName (exact), role and the selector (the same Locator the Locator methods take; query and nth are not accepted), in reading order. Never waits. role takes a qualified value (“<platform>.button”) or a bare one (“button”, meaning the session’s platform); a value scoped to another platform matches nothing.
{"id": 1, "method": "Accessibility.queryAXTree", "params": {}}
| Param | Type | Required | Description |
|---|
accessibleName | string | No | Exact computed name. |
role | string | No | Qualified (“<platform>.button”) or bare (“button”, the session platform). |
selector | Selector | No | Which element: a selector object tagged by kind. See Selectors. |
Result
| Field | Type | Description |
|---|
nodes | AXNode[] | |