Version:

ElementInspector

Provides element inspection capabilities for desktop windows.
Implements the ElementInspectionProviderInterface from @nut-tree/provider-interfaces.

typescript
class ElementInspector implements ElementInspectionProviderInterface

Methods

findElement

findElement(windowHandle: number, description: WindowElementDescription): Promise<WindowElement>

Tries to find a single element matching the given description, throws an error if none was found.

Parameters

windowHandlenumberThe window handle of the window to search in
descriptionWindowElementDescriptionThe partial description of the element to find

Returns

Promise<WindowElement>

findElements

findElements(windowHandle: number, description: WindowElementDescription): Promise<WindowElement[]>

Tries to find all elements matching the given description, returns an empty array if none was found.

Parameters

windowHandlenumberThe window handle of the window to search in
descriptionWindowElementDescriptionThe partial description of the element to find

Returns

Promise<WindowElement[]>

getElements

getElements(windowHandle: number, maxElements?: number): Promise<WindowElement>

Gets all elements in a window up to a maximum count.

Parameters

windowHandlenumberNative window handle of the window to inspect
maxElements?numberMaximum number of elements to return

Returns

Promise<WindowElement>

Was this page helpful?