sdk.automation.fillbyxpath
Home > @matterway/sdk > Automation > fillByXPath
Automation.fillByXPath() function
Types the value into a form field by Xpath, replacing the existing text.
Signature:
export declare function fillByXPath(ctx: Context, selector: string, value: string): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
ctx | Context | Context object. |
selector | string | Xpath selector. |
value | string | A text to type into field. |
Returns:
Promise<void>
Remarks
Triggers an event for each character. If you want to keep the existing text, use the helper "typeByXPath".
Example
await fillByXPath(ctx, '//input[@id="message"]', 'Hello')