Class AccessibilityAdapter
- Namespace
- OpenQA.Selenium.DevTools.V146.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
sessionIDevToolsSessionThe IDevToolsSession to be used with this adapter.
Exceptions
- ArgumentNullException
If
sessionis null.
Properties
Session
Gets the DevToolsSession associated with the adapter.
public IDevToolsSession Session { get; }
Property Value
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
commandDisableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandEnableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetAXNodeAndAncestorsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetChildAXNodesCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetFullAXTreeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetPartialAXTreeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetRootAXNodeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandQueryAXTreeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
NodesUpdated
The nodesUpdated event is sent every time a previously requested node has changed the in tree.
public event EventHandler<NodesUpdatedEventArgs>? NodesUpdated