Common Actions in Playwright

From the Playwright cheat sheet · Actions & Interactions · verified Jul 2026

Common Actions

Click, type, select, check, and interact with elements

typescript
// Click
await page.getByRole('button', { name: 'Save' }).click();

// Type into input
await page.getByLabel('Name').fill('John Doe');

// Select dropdown option
await page.getByLabel('Country').selectOption('us');

// Check/uncheck
await page.getByLabel('Remember me').check();
💡 fill() clears the input before typing — use pressSequentially() for char-by-char input
⚡ All actions auto-wait for the element to be visible and enabled before acting
📌 Use setInputFiles([]) to clear a file upload, and pass arrays for multiple files
🟢 Keyboard shortcuts work with page.keyboard.press() using modifier+key syntax
actionsclicktypefill
Back to the full Playwright cheat sheet