Skip to main content

sdk.automation.type

Home > @matterway/sdk > Automation > type

Automation.type() function

Types into a form field, after the existing text.

Signature:

export declare function type(ctx: Context, selector: string, value: string, options?: FillOptions & WaitForSelectorOptions): Promise<void>;

Parameters

ParameterTypeDescription
ctxContextContext object.
selectorstringCss selector.
valuestringA value to type into field.
optionsFillOptions & WaitForSelectorOptions(Optional)

Returns:

Promise<void>

Remarks

Triggers an event for each character. If you want to clear the field first, use the helper "fill".

Example 1

await type(ctx, 'input', 'Hello');

Example 2

await type(ctx, 'input', 'Hello', {
delay: 500,
clear: true,
blur: true,
});