← Back to Accessibility domain
Accessibility.queryAXTree
Query a DOM node's accessibility subtree for accessible name and role.
This command computes the name and role for all nodes in the subtree, including those that are
ignored for accessibility, and returns those that match the specified name and role. If no DOM
node is specified, or the DOM node does not exist, the command returns an error. If neither
`accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree.
Domain: Accessibility
experimental
Parameters
| Name | Type | Description |
nodeId (optional) | DOM.NodeId | Identifier of the node for the root to query. |
backendNodeId (optional) | DOM.BackendNodeId | Identifier of the backend node for the root to query. |
objectId (optional) | Runtime.RemoteObjectId | JavaScript object id of the node wrapper for the root to query. |
accessibleName (optional) | string | Find nodes with this computed name. |
role (optional) | string | Find nodes with this computed role. |
Returns
| Name | Type | Description |
nodes | array | A list of `Accessibility.AXNode` matching the specified attributes,
including nodes that are ignored for accessibility. |
Example Request
{
"id": 1,
"method": "Accessibility.queryAXTree"
}
Example Response
{
"id": 1,
"result": {
"nodes": []
}
}
Usage in Node.js
const result = await send('Accessibility.queryAXTree');
console.log(result);
// {"nodes": []}