Skip to main content
A node in a machine’s accessibility tree. Thin binding for simulang_rs::Node (macOS AXUIElement / Windows UIA element / Linux AT-SPI accessible / Android uiautomator snapshot node). Obtain via [Machine.focusedRoot], [Machine.systemRoot], [Machine.nodeAtPoint], [Instance.root], [Window.node], or via tree-walking methods on another node / Instance / Window (children, find, scoredSearch). Desktop nodes are live handles whose properties re-resolve from the platform accessibility framework on each access; Android nodes are part of a parsed snapshot whose actions resolve back to the live screen.

Constructor

Returns

AccessibilityNode

Properties

string
required
Stable element identifier that the inspected application’s own source code assigned to this element (e.g. for its UI tests), or the empty string when the application didn’t set one — most elements don’t have it.Each platform reads its native concept: UIA AutomationId on Windows, AXIdentifier on macOS, AT-SPI Accessible.AccessibleId on Linux, and the view resource-id on Android.
string
required
Platform class name (Windows UIA ClassName / macOS subrole / Android widget class).
string
required
Short description (AXDescription / UIA Name-adjacent fields).
string
required
Help text / tooltip.
boolean
required
Whether the node accepts user input.
null | boolean
required
Whether the platform reports the node as visible, or null when the visibility attribute cannot be read.On Windows this maps to UIA !IsOffscreen; on Linux to the AT-SPI Visible + Showing states. On macOS it reads the non-standard AXVisible attribute — a Chromium-specific extension that native apps don’t expose (→ null). Note Chromium’s accessibility-tree visibility is compositor-driven, not pixel-driven: many web-content nodes (including links) report AXVisible = false even when rendered, so filtering a browser window on isVisible === true can silently drop most of the page.
string
required
Localized control type string.
string
required
Accessible name (title / label).
string
required
Synthetic, query-friendly description used by scoredSearch (combines the node’s role, label, value, and a small amount of ancestor context).
AriaRole
required
Cross-platform ARIA role.
null | string
required
Hyperlink target of this node, or null when the node is not a link, the link has no target, or the platform backend does not expose the target through the accessibility API. The string is the raw URL as reported by the platform (no parsing or normalisation).
string
required
Current text value (textbox content, slider value as string, …).

Methods

activate()

Invoke / click the element (button, link, menu item).

ancestors()

Parent chain for this node, nearest parent first, excluding this node. Stops when a node has no parent; parent lookup failures throw.

Returns

AccessibilityNode[]

boundingBox()

Live bounding box of the element on the global desktop, in the canonical coordinate space (OS-native units; see [Machine]). right and bottom are exclusive (Playwright / DOM convention).

Returns

BoundingBox

children()

Direct child nodes. Throws when the subtree has been torn down or the children attribute is unreadable. (Tree walks — snapshot, scoredSearch, childrenCollapsed — treat such failures as “no children” instead, so one torn-down subtree cannot abort a whole walk.)

Returns

AccessibilityNode[]

childrenCollapsed()

Direct children with collapsible structural wrappers hoisted out: a child that is a collapsible structural wrapper is skipped and its own (recursively collapsed) children take its place, preserving sibling order. This is the single-level counterpart of the structural hoisting applied by tree walks, for callers that drive their own walks. An error from this node’s children() is propagated; errors from a collapsible wrapper’s own children() are treated as “no children” (the walkers’ convention), so one torn-down wrapper cannot abort the whole read.

Returns

AccessibilityNode[]

expandCollapse()

Expand or collapse a dropdown or tree item.

focus()

Move keyboard focus to this element (brings its window to the foreground as a side effect on most platforms).

isAncestorOf()

Whether this node is a strict ancestor of other.

Parameters

AccessibilityNode
required

Returns

boolean

isChildOf()

Whether this node is a direct child of other.

Parameters

AccessibilityNode
required

Returns

boolean

isDescendantOf()

Whether this node is a strict descendant of other.

Parameters

AccessibilityNode
required

Returns

boolean

isParentOf()

Whether this node is the direct parent of other.

Parameters

AccessibilityNode
required

Returns

boolean

lowestCommonAncestor()

Lowest shared ancestor for this node and other, plus that ancestor’s level from the reached parentless node (parentless = 0, its children = 1). Returns null when both chains resolve and no shared ancestor exists; lookup failures throw.

Parameters

AccessibilityNode
required

Returns

null | [AccessibilityNode, number]

parent()

Direct parent node, or null if this node has no parent. Parent lookup failures throw.

Returns

null | AccessibilityNode

scoredSearch()

Search this subtree by concept text, using bag-of-words paired-Jaccard scoring against each node’s overallDescription (simulang_rs::AXNodeSynthetic::summary_with_context). Returns every node whose score equals the maximum found and exceeds threshold — same semantics as simulang_rs::scored_search with BowJaccard::score(...).primary as the scorer and a permissive filter.
  • orderTraversalOrder.DepthFirst or TraversalOrder.BreadthFirst
  • max_nodes – upper bound on nodes visited (uses .take() over the walk)
  • collapse_structural – hoist empty structural wrappers out of the walk before scoring
  • query – natural-language concept Jaccard-compared against each node’s overallDescription
  • threshold – minimum score to keep a node

Parameters

TraversalOrder
required
number
required
boolean
required
string
required
number
required

Returns

AccessibilityNode[]

scrollIntoView()

Scroll the element into view.

select()

Select a tab, radio button, or list item.

setValue()

Set the text value of the element (textbox, combobox, …).

Parameters

string
required

showMenu()

Open the element’s context menu — the semantic equivalent of a right-click, without synthesizing pointer input, so it works on background / obscured windows (Windows ShowContextMenu, macOS AXShowMenu, Linux AT-SPI show-menu, Android long-press). The opened menu itself typically appears as the topmost / focused window even when the target window stays in the background — a user watching the desktop sees a menu pop up without having done anything. Throws when the element does not support opening a menu this way; callers can fall back to a coordinate right-click at the element’s boundingBox() center.

snapshot()

Render this node’s accessibility subtree as an indented Playwright-style aria snapshot string. One line per node, two spaces of indentation per depth level, in pre-order DFS. Roles are emitted raw (AXWindow on macOS, UIA.ControlType.* on Windows), with title and value appended when non-empty.

Returns

string

supportedActions()

Human-readable names of the actions this node currently supports (e.g. "activate", "toggle", "scroll_into_view").

Returns

string[]

toggle()

Toggle a checkbox or switch.