Appearance
Function: fill()
ts
function fill(
ctx: Context,
selector: string,
value: string,
options?: FillOptions): Promise<void>;Defined in: src/keyboard/index.ts:283
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');