Table of Contents

Interface IAccessibility

Namespace
Selenium.WebDriver.BiDi.Cdp.Accessibility
Assembly
Selenium.WebDriver.BiDi.Cdp.dll
[Experimental("BIDICDP001")]
public interface IAccessibility

Properties

LoadComplete

The loadComplete event mirrors the load complete event sent by the browser to assistive technology when the web page has finished loading.

IEventSource<LoadCompleteEventArgs> LoadComplete { get; }

Property Value

IEventSource<LoadCompleteEventArgs>

Remarks

Event args (LoadCompleteEventArgs):

  • Root - New document root node.

NodesUpdated

The nodesUpdated event is sent every time a previously requested node has changed the in tree.

IEventSource<NodesUpdatedEventArgs> NodesUpdated { get; }

Property Value

IEventSource<NodesUpdatedEventArgs>

Remarks

Event args (NodesUpdatedEventArgs):

  • Nodes - Updated node data.

Methods

DisableAsync(string?, CancellationToken)

Disables the accessibility domain.

Task<DisableResult> DisableAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<DisableResult>

A task representing the asynchronous operation, containing a DisableResult.

EnableAsync(string?, CancellationToken)

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.

Task<EnableResult> EnableAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<EnableResult>

A task representing the asynchronous operation, containing a EnableResult.

GetAXNodeAndAncestorsAsync(NodeId?, BackendNodeId?, RemoteObjectId?, string?, CancellationToken)

Fetches a node and all ancestors up to and including the root. Requires enable() to have been called previously.

Task<GetAXNodeAndAncestorsResult> GetAXNodeAndAncestorsAsync(NodeId? nodeId = null, BackendNodeId? backendNodeId = null, RemoteObjectId? objectId = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

nodeId NodeId

Identifier of the node to get.

backendNodeId BackendNodeId

Identifier of the backend node to get.

objectId RemoteObjectId

JavaScript object id of the node wrapper to get.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetAXNodeAndAncestorsResult>

A task representing the asynchronous operation, containing a GetAXNodeAndAncestorsResult.

GetChildAXNodesAsync(AXNodeId, FrameId?, string?, CancellationToken)

Fetches a particular accessibility node by AXNodeId. Requires enable() to have been called previously.

Task<GetChildAXNodesResult> GetChildAXNodesAsync(AXNodeId id, FrameId? frameId = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

id AXNodeId
frameId FrameId

The frame in whose document the node resides. If omitted, the root frame is used.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetChildAXNodesResult>

A task representing the asynchronous operation, containing a GetChildAXNodesResult.

GetFullAXTreeAsync(long?, FrameId?, string?, CancellationToken)

Fetches the entire accessibility tree for the root Document

Task<GetFullAXTreeResult> GetFullAXTreeAsync(long? depth = null, FrameId? frameId = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

depth long?

The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned.

frameId FrameId

The frame for whose document the AX tree should be retrieved. If omitted, the root frame is used.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetFullAXTreeResult>

A task representing the asynchronous operation, containing a GetFullAXTreeResult.

GetPartialAXTreeAsync(NodeId?, BackendNodeId?, RemoteObjectId?, bool?, string?, CancellationToken)

Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.

Task<GetPartialAXTreeResult> GetPartialAXTreeAsync(NodeId? nodeId = null, BackendNodeId? backendNodeId = null, RemoteObjectId? objectId = null, bool? fetchRelatives = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

nodeId NodeId

Identifier of the node to get the partial accessibility tree for.

backendNodeId BackendNodeId

Identifier of the backend node to get the partial accessibility tree for.

objectId RemoteObjectId

JavaScript object id of the node wrapper to get the partial accessibility tree for.

fetchRelatives bool?

Whether to fetch this node's ancestors, siblings and children. Defaults to true.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetPartialAXTreeResult>

A task representing the asynchronous operation, containing a GetPartialAXTreeResult.

GetRootAXNodeAsync(FrameId?, string?, CancellationToken)

Fetches the root node. Requires enable() to have been called previously.

Task<GetRootAXNodeResult> GetRootAXNodeAsync(FrameId? frameId = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

frameId FrameId

The frame in whose document the node resides. If omitted, the root frame is used.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetRootAXNodeResult>

A task representing the asynchronous operation, containing a GetRootAXNodeResult.

QueryAXTreeAsync(NodeId?, BackendNodeId?, RemoteObjectId?, string?, string?, string?, CancellationToken)

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.

Task<QueryAXTreeResult> QueryAXTreeAsync(NodeId? nodeId = null, BackendNodeId? backendNodeId = null, RemoteObjectId? objectId = null, string? accessibleName = null, string? role = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

nodeId NodeId

Identifier of the node for the root to query.

backendNodeId BackendNodeId

Identifier of the backend node for the root to query.

objectId RemoteObjectId

JavaScript object id of the node wrapper for the root to query.

accessibleName string

Find nodes with this computed name.

role string

Find nodes with this computed role.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<QueryAXTreeResult>

A task representing the asynchronous operation, containing a QueryAXTreeResult.