Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.simular.ai/llms.txt

Use this file to discover all available pages before exploring further.

Class: AccessibilityTree

Defined in: index.d.ts:114 Accessibility tree bound to a specific window. Provides snapshot and ref-based actions for desktop automation (Windows UIA).

Constructors

Constructor

new AccessibilityTree(): AccessibilityTree

Returns

AccessibilityTree

Accessors

windowId

Get Signature

get windowId(): number
Defined in: index.d.ts:127 Get the window handle as an integer ID.
Returns
number

windowTitle

Get Signature

get windowTitle(): string
Defined in: index.d.ts:125 Get the window title.
Returns
string

Methods

activate()

activate(refId): void
Defined in: index.d.ts:145 Invoke/click an element (button, link, menuitem).

Parameters

refId
number

Returns

void

clearRefs()

clearRefs(): void
Defined in: index.d.ts:163 Clear all stored element refs.

Returns

void

expandCollapse()

expandCollapse(refId): void
Defined in: index.d.ts:153 Expand or collapse a dropdown or tree item.

Parameters

refId
number

Returns

void

find()

find(order, role?, name?, visibleOnly?, maxResults?, collapseStructural?): AccessibilityNodeJs[]
Defined in: index.d.ts:186 Search the tree using the chosen traversal order.
  • orderTraversalOrder.DepthFirst or TraversalOrder.BreadthFirst
  • role – keep nodes whose ARIA role equals this value (e.g. AriaRole.Button, AriaRole.TabList, AriaRole.MenuBar). Cross-platform ARIA roles, not the platform-native UIA.ControlType.* / AX* / AT-SPI.Role.* vocabulary.
  • name – keep nodes whose title or description contains this string
  • visible_only – skip invisible nodes (default false)
  • max_results – stop after this many matches (uses .take())
  • collapse_structural – hoist empty structural wrappers (for example Pane / Group / Custom / Document on Windows, AXGroup / AXGenericGroup / AXUnknown on macOS, AT-SPI Panel / Filler / Section on Linux) out of the walk so role searches do not hit unnamed containers (default false)
Clears existing refs; returned nodes carry refId values usable with action methods (activate, setValue, …).

Parameters

order
TraversalOrder
role?
AriaRole | null
name?
string | null
visibleOnly?
boolean | null
maxResults?
number | null
collapseStructural?
boolean | null

Returns

AccessibilityNodeJs[]

focusElement()

focusElement(refId): void
Defined in: index.d.ts:157 Focus an element (brings window to foreground).

Parameters

refId
number

Returns

void

getBounds()

getBounds(refId): BoundingBox
Defined in: index.d.ts:159 Get the live bounding box of an element.

Parameters

refId
number

Returns

BoundingBox

getSupportedActions()

getSupportedActions(refId): string[]
Defined in: index.d.ts:161 Get the list of supported actions for an element.

Parameters

refId
number

Returns

string[]

scrollIntoView()

scrollIntoView(refId): void
Defined in: index.d.ts:155 Scroll an element into view.

Parameters

refId
number

Returns

void

select()

select(refId): void
Defined in: index.d.ts:151 Select a tab, radio button, or list item.

Parameters

refId
number

Returns

void

setValue()

setValue(refId, value): void
Defined in: index.d.ts:147 Set the text value of an element (textbox, combobox).

Parameters

refId
number
value
string

Returns

void

snapshot()

snapshot(visibleOnly?): AccessibilityNodeJs
Defined in: index.d.ts:143 Take a snapshot of the window’s accessibility tree. visible_only (default false) controls whether nodes whose non-standard AXVisible attribute reads false are dropped from the result. AXVisible is a Chromium-specific extension; native macOS apps don’t expose it, so the filter only matters for browser windows. Chrome reports many web-content nodes (including AXLink) as AXVisible=false because its accessibility-tree visibility is compositor-driven, not pixel-driven — setting visible_only=true on a Chrome window will silently drop most of the page including links.

Parameters

visibleOnly?
boolean | null

Returns

AccessibilityNodeJs

toggle()

toggle(refId): void
Defined in: index.d.ts:149 Toggle a checkbox or switch.

Parameters

refId
number

Returns

void

fromForeground()

static fromForeground(): AccessibilityTree
Defined in: index.d.ts:116 Create an accessibility tree bound to the current foreground window.

Returns

AccessibilityTree

fromHwnd()

static fromHwnd(hwnd): AccessibilityTree
Defined in: index.d.ts:123 Create an accessibility tree from a platform-specific window identifier. On Windows this is an HWND; on macOS it is a PID.

Parameters

hwnd
number

Returns

AccessibilityTree

fromPid()

static fromPid(pid): AccessibilityTree
Defined in: index.d.ts:118 Create an accessibility tree bound to the first visible window of a process.

Parameters

pid
number

Returns

AccessibilityTree