Users normally access most website functionality through clicks, keystrokes etc. Playwright allows us to replicate these events by referencing elements on the page using User-first Selectors.Documentation Index
Fetch the complete documentation index at: https://checkly-422f444a-sync-playwright-reporter-changelog-v1-5-0.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Clicking
Clicking is the default way of selecting and activating elements on web pages, and will appear very often in most headless scripts.basic-click.spec.ts
Hovering
A popular pattern among web pages is exposing additional information or functionality when the user hovers the mouse cursor over a specific item. Examples include, menus, previews and dialogs containing extra information on the item.basic-hover.spec.ts
Focussing
Focussing on specific UI elements allows the user to interact with them without clicks. It can also result in a proactive reaction from the webapp, such as displaying suggestions.basic-focus.spec.ts
Typing
We can simulate typing on a real keyboard usingpage.type():
basic-type.spec.ts
- Playwright:
await page.press('Enter')
await (await page.$('input[type="text"]')).press('Enter')
We can also hold down and release one or more keys, possibly combining them to use keyboard shortcuts:
Bugs don’t stop at CI/CD. Why would Playwright? 
Sign up and start using Playwright for end-to-end monitoring with Checkly.
Further reading
- The related official documentation of Playwright
- Finding effective selectors