Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
method Keyboard.prototype.type
import { Keyboard } from "https://deno.land/x/puppeteer@16.2.0/vendor/puppeteer-core/puppeteer/common/Input.d.ts";

Sends a keydown, keypress/input, and keyup event for each character in the text.

Examples

Example 1

await page.keyboard.type('Hello'); // Types instantly
await page.keyboard.type('World', {delay: 100}); // Types slower, like a user

Parameters

text: string
  • A text to type into a focused element.
optional
options: { delay?: number; }
  • An object of options. Accepts delay which, if specified, is the time to wait between keydown and keyup in milliseconds. Defaults to 0.

Returns

Promise<void>