Module

x/fresh/tests/deps.ts>Page#type

The next-gen web framework.
Extremely Popular
Go to Latest
method Page.prototype.type
import { Page } from "https://dotland.deno.dev/x/fresh@1.5.2/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 {@link Keyboard.press}.

Examples

Example 1

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

Parameters

selector: string
  • A selector of an element to type into. If there are multiple elements satisfying the selector, the first will be used.
text: string
  • A text to type into a focused element.
optional
options: { delay: number; }
  • have property delay which is the Time to wait between key presses in milliseconds. Defaults to 0.

Returns

Promise<void>