Appearance
Variable: fillByXPath()
ts
const fillByXPath: (ctx: Context, selector: string, value: string, options?: FillOptions) => Promise<void> = fill;Defined in: src/keyboard/index.ts:325
Type a value into a form field, replacing existing text.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Context object. |
selector | string | CSS selector. |
value | string | Text to type into the field. |
options? | FillOptions | Fill behavior: delay, blur, maxTries, retryDelay. |
Returns
Promise<void>
Remarks
Fire an event for each character. To keep the existing text, use type.
Example
ts
// Fill in a login username
await fill(ctx, '#username', 'rocketman_42');Deprecated
Use fill instead.
Type a value into a form field by XPath, replacing existing text.
Param
Context object.
Param
XPath selector.
Param
Text to type into the field.