TOPIC 09/6018 MINNOT STARTED

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.

  1. Point
  2. Write
  3. Tick
  4. Press a key
Match the verb to the person

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The helper handThe test
A plain verb such as press or writeA page action
Typing key by keySequential typing
Forcing a door openA 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.

What each part of the trick stands for
In the trickWhat it stands for
Plain verbpress, write, tick, choose
Forced actionskips 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
  1. 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)

    Describes the built-in actions on a locator: fill for text boxes, pressSequentially for keystroke by keystroke typing, check and uncheck, selectOption, hover, dragTo, press for single keys, and click with modifier keys such as ControlOrMeta (from version 1.45). Says dragTo hovers, presses, moves and releases, and that hover, mouse down, mouse move and mouse up can be used for finer control. The search returned this TypeScript page (https://playwright.dev/docs/input) as well as the Python and Java versions. The reference pages mark the page-level fill and selectOption as discouraged in favour of locator methods. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-10-18

    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.

  2. 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.

    Says Playwright runs actionability checks (visible, stable, enabled, receives events) before an action and fails with a timeout error if they do not pass in time. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-11-06

    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.

  3. Market practice

    Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Use locators that wait and retry instead of fixed pauses (search excerpt, page not opened)

    Recommends user-facing locators such as role-based ones over Cascading Style Sheets (CSS) or XPath, web-first assertions that retry, and avoiding fixed waits. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-10-18

    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).

  4. 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.

    Says locator.setInputFiles takes a path, an array of paths, an empty array to clear, or an in-memory buffer, and that the file chooser route is for inputs created on the fly. Vendor documentation for one tool. Practitioner or vendor guidance, not a standard. · Checked 2026-11-06

    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.

  5. 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.

    Reference for locator.setInputFiles, which sets the files of a file input from paths or in-memory buffers, resolves relative paths from the working directory and clears the selection with an empty array; also frameLocator for content inside an iframe. Vendor documentation for one tool. Practitioner or vendor guidance, not a standard. · Checked 2026-11-06

    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
  1. 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)

    Describes the built-in actions on a locator: fill for text boxes, pressSequentially for keystroke by keystroke typing, check and uncheck, selectOption, hover, dragTo, press for single keys, and click with modifier keys such as ControlOrMeta (from version 1.45). Says dragTo hovers, presses, moves and releases, and that hover, mouse down, mouse move and mouse up can be used for finer control. The search returned this TypeScript page (https://playwright.dev/docs/input) as well as the Python and Java versions. The reference pages mark the page-level fill and selectOption as discouraged in favour of locator methods. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-10-18

    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.

  2. 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.

    Says Playwright runs actionability checks (visible, stable, enabled, receives events) before an action and fails with a timeout error if they do not pass in time. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-11-06

    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.

  3. Market practice

    Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Use locators that wait and retry instead of fixed pauses (search excerpt, page not opened)

    Recommends user-facing locators such as role-based ones over Cascading Style Sheets (CSS) or XPath, web-first assertions that retry, and avoiding fixed waits. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-10-18

    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).

  4. 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.

    Says locator.setInputFiles takes a path, an array of paths, an empty array to clear, or an in-memory buffer, and that the file chooser route is for inputs created on the fly. Vendor documentation for one tool. Practitioner or vendor guidance, not a standard. · Checked 2026-11-06

    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.

  5. 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.

    Reference for locator.setInputFiles, which sets the files of a file input from paths or in-memory buffers, resolves relative paths from the working directory and clears the selection with an empty array; also frameLocator for content inside an iframe. Vendor documentation for one tool. Practitioner or vendor guidance, not a standard. · Checked 2026-11-06

    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.