sdk.automation.clearinput
Home > @matterway/sdk > Automation > clearInput
Automation.clearInput() function
Warning: This API is now obsolete.
- Use Use
fill
with an empty text instead.
Clears the value in an input element.
Signature:
export declare function clearInput(ctx: Context, selector: string): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
ctx | Context | Context object. |
selector | string | Selector for input element to clear. |
Returns:
Promise<void>
Remarks
Keep in mind that using the helper "Clear" on form fields will not trigger change events, and the website will not see the change. In this case, one almost always want to use "fill" or "type" instead.
Example
await clearInput(ctx, 'input[id="E-mail"]');