docs/api/puppeteer.page.type.md
Sends a keydown, keypress/input, and keyup event for each character in the text.
To press a special key, like Control or ArrowDown, use Keyboard.press().
class Page {
type(
selector: string,
text: string,
options?: Readonly<KeyboardTypeOptions>,
): Promise<void>;
}
Parameter
</th><th>Type
</th><th>Description
</th></tr></thead> <tbody><tr><td>selector
</td><td>string
</td><td>selector to query the page for. CSS selectors can be passed as-is and a Puppeteer-specific selector syntax allows querying by text, a11y role and name, and xpath and combining these queries across shadow roots. Alternatively, you can specify the selector type using a prefix.
</td></tr> <tr><td>text
</td><td>string
</td><td>A text to type into a focused element.
</td></tr> <tr><td>options
</td><td>Readonly<KeyboardTypeOptions>
</td><td>(Optional) have property delay which is the Time to wait between key presses in milliseconds. Defaults to 0.
Returns:
Promise<void>
await page.type('#mytextarea', 'Hello');
// Types instantly
await page.type('#mytextarea', 'World', {delay: 100});
// Types slower, like a user