Inspect and test the UI inside your WebView
Find HTML elements, inspect their visible state, and try guarded interactions inside your Cordova/Capacitor app.
DOM Inspection tools help investigate the HTML UI inside your app’s WebView, including element labels, values, attributes, and layout bounds. Find the elements you need with CSS queries, and opt into guarded actions when a development workflow needs to interact with them.
const options = Ansight.createOptionsBuilder()
.withReadOnlyToolAccess()
.withDomTools({
includeHidden: false,
includeText: true,
includeAttributes: true,
maxDepth: 30,
maxNodes: 1500,
allowActions: false,
})
.build();
DOM tree responses use the shared compact visual-tree v2 contract. HTML tag names are stored in the top-level types registry and referenced by node typeId; DOM ids and supported test attributes can become automationId values.
| Id | Policy | Purpose |
|---|---|---|
dom.get_document | Read | Return the accessible HTML tree, layout bounds, labels, values, and selected attributes. |
dom.inspect_node | Read | Refresh details for one captured DOM node id. |
dom.query_selector | Read | Find up to 200 nodes using a CSS selector. |
dom.invoke_action | Write | Click, focus, blur, or set a supported form value. |
dom.invoke_action is registered only with allowActions: true and still requires write access from the tool guard. DOM text, attributes, and values may contain personal or secret data; tune inclusion and limits accordingly.