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
Parameter | Type | Description |
---|---|---|
ctx | Context | Context object. |
selector | string | Css selector. |
value | string | A value to type into field. |
options | FillOptions & 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,
});