Skip to main content
Version: 1.x

Function: waitForControlState()

waitForControlState(locator, predicate, options?): Promise<ControlWaitResult>

Waits until a specific control satisfies a predicate.

Parameters​

locator​

Locator

Locator for the control.

predicate​

ControlPredicate

Browser-side predicate receiving the control's element.

options?​

WaitForControlStateOptions

Timeout and message overrides.

Returns​

Promise<ControlWaitResult>

Which strategy satisfied the wait.

Remarks​

On Playwright 1.62+ the predicate receives the control's DOM element directly. Below that it runs page-scoped against the element resolved from the control id, which is equivalent but slightly less precise if the id changes mid-wait.

Controls are resolved with sap/ui/core/Element.closestTo() rather than the deprecated sap.ui.getCore().byId(), so this adds no new praman/no-deprecated-ui5-globals findings.

Throws​

TimeoutError when the predicate does not become true in time.

Capability​

ui5Wait.forControlState

Example​

await waitForControlState(
table,
(el) => !el.classList.contains('sapUiLocalBusy'),
{ timeout: 20_000 },
);