Skip to content

Function: waitForValueChange()

ts
function waitForValueChange(
   ctx: Context, 
   selector: string, 
waitOptions?: WaitValueOptions): Promise<ElementHandle<Element> | null>;

Defined in: src/wait/waiters/waitForValueChange.ts:28

Wait for the value of an input element to change.

Parameters

ParameterTypeDescription
ctxContextContext object.
selectorstringCSS selector for the input element.
waitOptions?WaitValueOptionsTimeout, polling, and initial value settings.

Returns

Promise<ElementHandle<Element> | null>

The element handle after the value changes.

Example

ts
// Wait for the search box to get new text
const handle = await waitForValueChange(ctx, '#search-box', {
  timeout: 5000,
  polling: 100,
  initialValue: '',
});
console.log('Search text changed!', handle);

Matterway Assistant SDK Documentation