import { Page } from "https://deno.land/x/fresh@1.5.4/tests/deps.ts";
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.
Examples
Example 1
Example 1
await page.type('#mytextarea', 'Hello');
// Types instantly
await page.type('#mytextarea', 'World', {delay: 100});
// Types slower, like a user
Parameters
- A selector of an element to type into. If there are multiple elements satisfying the selector, the first will be used.