Package io.webfolder.cdp.command
Interface Accessibility
public interface Accessibility
-
Method Summary
Modifier and TypeMethodDescriptionvoid
disable()
Disables the accessibility domain.void
enable()
Enables the accessibility domain which causes AXNodeIds to remain consistent between method calls.Fetches a node and all ancestors up to and including the root.getAXNodeAndAncestors
(Integer nodeId, Integer backendNodeId, String objectId) Fetches a node and all ancestors up to and including the root.Fetches a particular accessibility node by AXNodeId.getChildAXNodes
(String id, String frameId) Fetches a particular accessibility node by AXNodeId.Fetches the entire accessibility tree for the root DocumentgetFullAXTree
(Integer depth, String frameId) Fetches the entire accessibility tree for the root DocumentFetches the accessibility node and partial accessibility tree for this DOM node, if it exists.getPartialAXTree
(Integer nodeId, Integer backendNodeId, String objectId, Boolean fetchRelatives) Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.Fetches the root node.getRootAXNode
(String frameId) Fetches the root node.Query a DOM node's accessibility subtree for accessible name and role.queryAXTree
(Integer nodeId, Integer backendNodeId, String objectId, String accessibleName, String role) Query a DOM node's accessibility subtree for accessible name and role.
-
Method Details
-
disable
void disable()Disables the accessibility domain. -
enable
void enable()Enables the accessibility domain which causes AXNodeIds to remain consistent between method calls. This turns on accessibility for the page, which can impact performance until accessibility is disabled. -
getAXNodeAndAncestors
Fetches a node and all ancestors up to and including the root. Requires enable() to have been called previously. -
getAXNodeAndAncestors
Fetches a node and all ancestors up to and including the root. Requires enable() to have been called previously.- Parameters:
nodeId
- Identifier of the node to get.backendNodeId
- Identifier of the backend node to get.objectId
- JavaScript object id of the node wrapper to get.
-
getChildAXNodes
Fetches a particular accessibility node by AXNodeId. Requires enable() to have been called previously. -
getChildAXNodes
Fetches a particular accessibility node by AXNodeId. Requires enable() to have been called previously.- Parameters:
frameId
- The frame in whose document the node resides. If omitted, the root frame is used.
-
getFullAXTree
Fetches the entire accessibility tree for the root Document -
getFullAXTree
Fetches the entire accessibility tree for the root Document- Parameters:
depth
- The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned.frameId
- The frame for whose document the AX tree should be retrieved. If omited, the root frame is used.
-
getPartialAXTree
Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.- Returns:
- The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
-
getPartialAXTree
List<AXNode> getPartialAXTree(Integer nodeId, Integer backendNodeId, String objectId, Boolean fetchRelatives) Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.- Parameters:
nodeId
- Identifier of the node to get the partial accessibility tree for.backendNodeId
- Identifier of the backend node to get the partial accessibility tree for.objectId
- JavaScript object id of the node wrapper to get the partial accessibility tree for.fetchRelatives
- Whether to fetch this nodes ancestors, siblings and children. Defaults to true.- Returns:
- The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
-
getRootAXNode
AXNode getRootAXNode()Fetches the root node. Requires enable() to have been called previously. -
getRootAXNode
Fetches the root node. Requires enable() to have been called previously.- Parameters:
frameId
- The frame in whose document the node resides. If omitted, the root frame is used.
-
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 mactch 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.- Returns:
- A list of Accessibility.AXNode matching the specified attributes, including nodes that are ignored for accessibility.
-
queryAXTree
List<AXNode> queryAXTree(Integer nodeId, Integer backendNodeId, String objectId, String accessibleName, String role) 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 mactch 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.- Parameters:
nodeId
- Identifier of the node for the root to query.backendNodeId
- Identifier of the backend node for the root to query.objectId
- JavaScript object id of the node wrapper for the root to query.accessibleName
- Find nodes with this computed name.role
- Find nodes with this computed role.- Returns:
- A list of Accessibility.AXNode matching the specified attributes, including nodes that are ignored for accessibility.
-