Skip to content
masterclass Buddy

Playwright · Class

Keyboard

Playwright's Keyboard API controls a virtual keyboard. Use press() for keys and shortcuts, type() for text, and down()/up() to hold and release keys.

Last updated

Since
v1.9

Syntax

page.keyboard.press(key, options); page.keyboard.type(text, options); page.keyboard.down(key); page.keyboard.up(key); page.keyboard.insertText(text);

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Keyboard.down()
  • Keyboard.insertText()
  • Keyboard.press()
  • Keyboard.type()
  • Keyboard.up()

Source: Keyboard | Playwright. Checked 2026-11-03.