Skip to main content

Function: findByLabelText()

findByLabelText(container, text, options?): Promise<Widget>

Defined in: queries.ts:408

Finds a single element that is labelled by a GtkLabel whose text matches.

Waits for the element to appear, throwing if not found within timeout. Uses GtkLabel's mnemonic widget association to find form elements.

Parameters

ParameterTypeDescription
containerContainerThe container to search within
textTextMatchLabel text to match (string, RegExp, or custom matcher)
options?TextMatchOptionsQuery options including normalization and timeout

Returns

Promise<Widget>

Promise resolving to the labelled widget

Example

const input = await findByLabelText(container, "Username");