press
Send a key to the current page and identify the focused element afterwards, enabling tests of keyboard navigation, form submission, and dialog closing.
Instructions
Press a key on the current page and report which element holds the focus afterwards. Use it to test keyboard access, to submit a form with Enter or to close a dialog with Escape.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key name as Playwright writes it, such as Tab, Shift+Tab, Enter, Escape, ArrowDown or Space. |