sdk.automation.typebyxpath
Home > @matterway/sdk > Automation > typeByXPath
Automation.typeByXPath() function
Types into a form field by Xpath, after the existing text.
Signature:
export declare function typeByXPath(ctx: Context, selector: string, value: string, options?: FillOptions): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
ctx | Context | Context object. |
selector | string | Xpath selector. |
value | string | A text to type into field. |
options | FillOptions | (Optional) |
Returns:
Promise<void>
Remarks
Triggers an event for each character. If you want to clear the field first, use the helper "fillByXPath".
Example 1
await typeByXPath(ctx, '//input[@id="message"]', 'Hello');
Example 2
await typeByXPath(ctx, '//input[@id="message"]', 'Hello', {
delay: 500,
clear: true,
blur: true,
});