Table of Contents

Class AccessibilityAdapter

Namespace
OpenQA.Selenium.DevTools.V148.Accessibility
Assembly
Selenium.WebDriver.dll

Represents an adapter for the Accessibility domain to simplify the command interface.

public class AccessibilityAdapter
Inheritance
AccessibilityAdapter
Inherited Members

Constructors

AccessibilityAdapter(IDevToolsSession)

Initializes a new instance of the AccessibilityAdapter class.

public AccessibilityAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

Disable(DisableCommandSettings?, CancellationToken, int?, bool)

Disables the accessibility domain.

public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisableCommandResponse>

Enable(EnableCommandSettings?, CancellationToken, int?, bool)

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.

public Task<EnableCommandResponse?> Enable(EnableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

GetAXNodeAndAncestors(GetAXNodeAndAncestorsCommandSettings, CancellationToken, int?, bool)

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

public Task<GetAXNodeAndAncestorsCommandResponse> GetAXNodeAndAncestors(GetAXNodeAndAncestorsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetAXNodeAndAncestorsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetAXNodeAndAncestorsCommandResponse>

GetChildAXNodes(GetChildAXNodesCommandSettings, CancellationToken, int?, bool)

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

public Task<GetChildAXNodesCommandResponse> GetChildAXNodes(GetChildAXNodesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetChildAXNodesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetChildAXNodesCommandResponse>

GetFullAXTree(GetFullAXTreeCommandSettings, CancellationToken, int?, bool)

Fetches the entire accessibility tree for the root Document

public Task<GetFullAXTreeCommandResponse> GetFullAXTree(GetFullAXTreeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetFullAXTreeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetFullAXTreeCommandResponse>

GetPartialAXTree(GetPartialAXTreeCommandSettings, CancellationToken, int?, bool)

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

public Task<GetPartialAXTreeCommandResponse> GetPartialAXTree(GetPartialAXTreeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetPartialAXTreeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetPartialAXTreeCommandResponse>

GetRootAXNode(GetRootAXNodeCommandSettings, CancellationToken, int?, bool)

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

public Task<GetRootAXNodeCommandResponse> GetRootAXNode(GetRootAXNodeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetRootAXNodeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetRootAXNodeCommandResponse>

QueryAXTree(QueryAXTreeCommandSettings, CancellationToken, int?, bool)

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.

public Task<QueryAXTreeCommandResponse> QueryAXTree(QueryAXTreeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command QueryAXTreeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<QueryAXTreeCommandResponse>

Events

LoadComplete

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

public event EventHandler<LoadCompleteEventArgs>? LoadComplete

Event Type

EventHandler<LoadCompleteEventArgs>

NodesUpdated

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

public event EventHandler<NodesUpdatedEventArgs>? NodesUpdated

Event Type

EventHandler<NodesUpdatedEventArgs>