Skip to main content

Function: findByRole()

findByRole(container, role, options?): Promise<Widget>

Defined in: queries.ts:354

Finds a single element by accessible role.

Waits for the element to appear, throwing if not found within timeout.

Parameters

ParameterTypeDescription
containerContainerThe container to search within
roleAccessibleRoleThe GTK accessible role to match
options?ByRoleOptionsQuery options including name, state filters, and timeout

Returns

Promise<Widget>

Promise resolving to the matching widget

Example

const button = await findByRole(container, Gtk.AccessibleRole.BUTTON, { name: "Submit" });