Skip to main content
A node in the platform accessibility tree. Thin binding for simulang_rs::AXNode (macOS AXUIElement / Windows UIA element / Linux AT-SPI accessible). Construct via the static factories or via tree-walking methods on another node / Instance / Window (children, find, scoredSearch). Properties are resolved from the underlying accessibility framework on each access; the node itself is just a handle.

Constructor

Returns

AccessibilityNode

Properties

string
required
UIA AutomationId (Windows). Empty on macOS / Linux.
string
required
Platform class name (Windows UIA ClassName / macOS subrole).
number
required
Numeric control type (UIA_ControlTypeIds on Windows, 0 on macOS).
string
required
Short description (AXDescription / UIA Name-adjacent fields).
string
required
Help text / tooltip.
boolean
required
Whether the node accepts user input.
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.
string
required
Current text value (textbox content, slider value as string, …).

Methods

activate()

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

boundingBox()

Live bounding box of the element in global physical pixels. right and bottom are exclusive (Playwright / DOM convention).

Returns

BoundingBox

children()

Direct child nodes. Returns an empty array if the subtree has been torn down or the children attribute is unreadable (matching simulang-rs’s convention of treating walk failures as “no children”).

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).

fromFocusedApplication()

Root node of the currently focused application’s accessibility tree.

Returns

AccessibilityNode

fromPid()

Root node of the application identified by pid.

Parameters

number
required

Returns

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

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.