Acting on the page: click, fill, check, select, hover, drag and keys
Learn the few verbs a test uses on a page, pick the one that matches what a person does, and leave force for the rare case.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a helper hand with a short list of verbs. The hand cannot guess. You say press, write, tick, choose, point, carry, or hit a key. Each verb is a different motion, and the wrong verb does the wrong thing.
Daily List is a to-do list app. Tom, the tester, wants a test that signs Lily up, ticks a box, chooses a plan, and adds a task. Playwright is the helper hand. Each verb is a .
What it is: Playwright is a library that drives a real browser. This slice is the page actions a test uses on an element it has already found. You pick the verb a person would use. The nearest neighbour is a raw mouse click on everything, including a checkbox or a select list. Selenium and Cypress offer the same family of verbs, with different method names.
Why it matters: A click on a checkbox flips it, so a second run can untick a box the test meant to leave ticked. The call check aims at the end state. Clear verbs keep the script close to what Lily does, and the built-in waits mean Tom does not add pauses between them.
A helper hand would feel a covered button. Playwright only knows what the page reports, so a banner that covers Add task must be closed the way a person would close it.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named here are made up.)
PLAIN WORDS · 4 in this section
- playwright
- a free Microsoft tool that drives a browser for tests
- selenium
- A free tool that drives a web browser for checks.
- cypress
- A free tool that drives a web browser for checks.
- untick
- take the tick off a task
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Telling a test what to do on a page with a few plain verbs that match what a person does.
- Point
- Write
- Tick
- Press a key
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The helper hand | The test |
| A plain verb such as press or write | A page action |
| Typing key by key | Sequential typing |
| Forcing a door open | A forced action |
WHERE THIS PICTURE STOPS
- A helper hand could feel a covered button. Playwright knows only what the page tells it.
- A hand has no checks of its own. Playwright waits for the element to be ready first.
- A person picks a verb by instinct. A tester must choose the verb on purpose.
HOOK
Match the verb to the person.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
Usually, pick the plain verb a person would use, and let Playwright check before it acts rather than forcing it.
| In the trick | What it stands for |
|---|---|
| Plain verb | press, write, tick, choose |
| Forced action | skips the checks before it acts |
A forced action skips the checks, so it can press something a person could not.
TELL A FRIEND
A helper hand that does only the plain verbs you give it, and checks the door is free first.
OFTEN MIXED UP WITH Finding elements: getByRole, getByLabel, getByText and test ids. The earlier lesson finds the element. This lesson says what to do to it once it is found.
Sources & standards — 5 sources
- Market practice
Actions (Playwright documentation) ↗ — Microsoft (Playwright) · Actions on a locator include fill, pressSequentially (with a delay option), check, uncheck, selectOption, hover, dragTo, press and click with modifier keys; fill is the default for text entry (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Auto-waiting (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Use locators that wait and retry instead of fixed pauses (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. A second search on 2026-10-20 returned this page for its title and matched the described content; the page was still not opened (search excerpt, page not opened).
- Market practice
Actions (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Locator (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: selectOption, setChecked, setInputFiles and tap. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: selectOption, setChecked, setInputFiles and tap. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
PRACTISE AND KEEP
Sources for this topic — 5 sources
- Market practice
Actions (Playwright documentation) ↗ — Microsoft (Playwright) · Actions on a locator include fill, pressSequentially (with a delay option), check, uncheck, selectOption, hover, dragTo, press and click with modifier keys; fill is the default for text entry (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Auto-waiting (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Use locators that wait and retry instead of fixed pauses (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. A second search on 2026-10-20 returned this page for its title and matched the described content; the page was still not opened (search excerpt, page not opened).
- Market practice
Actions (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Locator (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: selectOption, setChecked, setInputFiles and tap. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: selectOption, setChecked, setInputFiles and tap. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.