Function clearAndTypeByXpath

  • Selects an input element by Xpath, clears and types into it.

    Parameters

    • ctx: Context

      Context object.

    • selector: string

      Selector for input field.

    • value: string

      Value to type into input field.

    Returns Promise<void>

    Deprecated

    • Use fillByXPath instead.

    Remarks

    Keep in mind that using the helper "clearAndTypeByXpath" 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 clearAndTypeByXpath(ctx, '//input[@id="firstName"]', 'John');
    

Generated using TypeDoc