DomSnapshot Class

Snapshots of DOM subtrees: their HTML formatted for comparisons, and their accessibility tree.

public static class DomSnapshot

Methods

NameDescription
GetAccessibilitySnapshot(IEnumerable<Node>)Gets the accessibility tree of elements, as a YAML snapshot (the format of the ARIA snapshots of Playwright).
GetMarkup(IReadOnlyList<Node>, MarkupOptions?)Gets the HTML of nodes, formatted for snapshots (see MarkupOptions).

GetAccessibilitySnapshot(IEnumerable<Node>)

DomSnapshot.cs

Gets the accessibility tree of elements, as a YAML snapshot (the format of the ARIA snapshots of Playwright).

public static string GetAccessibilitySnapshot(IEnumerable<Node> nodes)

Parameters

nodes IEnumerable<Node>
The nodes; the nodes that are not elements are ignored.

Returns

string The snapshot.

GetMarkup(IReadOnlyList<Node>, MarkupOptions?)

DomSnapshot.cs

Gets the HTML of nodes, formatted for snapshots (see MarkupOptions).

public static string GetMarkup(IReadOnlyList<Node> nodes, MarkupOptions? options = null)

Parameters

nodes IReadOnlyList<Node>
The nodes.
options MarkupOptions?
The options, or null for the default options.

Returns

string The HTML.