AccessibilityNode Class
A node of a snapshot of the accessibility tree, created by Element.CaptureAccessibilityTree: an element with a role, or a run of text. The snapshot does not follow the later changes of the document.
public sealed class AccessibilityNodeProperties
| Name | Description |
|---|---|
| Children | The children of the node, in the order of the accessibility tree: the flat tree (the shadow trees and their slotted nodes), with the relocations of aria-owns. The elements without a role, the presentational elements and the generic elements (e.g. div, span) are not nodes: their children are children of their parent. |
| Node | The DOM node of the accessibility node: the Element, or, for a run of text, its first Text node (the element whose ::before or ::after content is the text when there is no text node). |
| Parent | The parent node, or null for the root of the snapshot. |
| Properties | The role, the name, the description and the states of the node. |
Children
AccessibilityNode.csThe children of the node, in the order of the accessibility tree: the flat tree (the shadow trees and their slotted nodes), with the relocations of aria-owns. The elements without a role, the presentational elements and the generic elements (e.g. div, span) are not nodes: their children are children of their parent.
public IReadOnlyList<AccessibilityNode> Children { get; }Property value
Parent
AccessibilityNode.csThe parent node, or null for the root of the snapshot.
public AccessibilityNode? Parent { get; }Property value
Properties
AccessibilityNode.csThe role, the name, the description and the states of the node.
public AccessibilityProperties Properties { get; }Property value
Methods
| Name | Description |
|---|---|
| ToAriaSnapshot() | Returns the subtree in the YAML format of the aria snapshots of Playwright (https://playwright.dev/docs/aria-snapshots), e.g. - heading "Title" [level=1]. The children of a root without a role, presentational or generic, are written at the first level. |
| ToString() | Returns the role, the name and the states of the node, as the key of a line of AccessibilityNode.ToAriaSnapshot. |
ToAriaSnapshot()
AccessibilityNode.csToString()
AccessibilityNode.csReturns the role, the name and the states of the node, as the key of a line of AccessibilityNode.ToAriaSnapshot.
public override string ToString()