Skip to main content

sdk.automation.clearinputbyxpath

Home > @matterway/sdk > Automation > clearInputByXPath

Automation.clearInputByXPath() function

Warning: This API is now obsolete.

  • Use Use fillByXPath with an empty text instead.

Clears the value in an input element by Xpath.

Signature:

export declare function clearInputByXPath(ctx: Context, selector: string): Promise<void>;

Parameters

ParameterTypeDescription
ctxContextContext object.
selectorstringSelector for input element to clear.

Returns:

Promise<void>

Remarks

Keep in mind that using the helper "clearInputByXPath" 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 "fillByXPath" or "typeByXPath" instead.

Example

await clearInputByXPath(ctx, '//input[@id="firstName"]');