AccessibilitySnapshotter

Takes snapshots for one driver: runs the atom in each document and stitches child frames into the tree.

Constructor

new AccessibilitySnapshotter(drivernon-null, elementFactory)

Parameters:
NameTypeDescription
driverWebDriver

The driver to snapshot through.

elementFactoryfunction

Makes the element for a shared id.

Methods

(async) contexts_()

The window's browsing contexts, top-level first, then each frame depth-first.

(async) snapshot(rootnullable, optionsopt) → (non-null) {Promise.<!AccessibilityNode>}

Snapshots the driver's current browsing context, or the subtree under root.

Parameters:
NameTypeAttributesDescription
rootWebElement<nullable>

The element whose subtree to snapshot, or null for the document of the driver's current browsing context: the top-level document, or the frame the driver has switched into.

optionsObject<optional>

With interestingOnly true, the default, unnamed generic and presentational elements produce no node and their children take their place; with false every rendered element produces a node.

Throws:

When root no longer belongs to a document.

Type
error.StaleElementReferenceError
Returns:

The snapshot, with every reachable child frame's tree attached under its iframe node. The driver's current browsing context is left as it was.

Type: 
Promise.<!AccessibilityNode>