What Playwright is, and how it drives a browser
Playwright opens a real browser and follows the steps your test code gives it. See what it does, why testers pick it, and what it cannot judge.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a robot that presses the buttons of a television remote for you. You want every channel button to work. You could press each one yourself every day. A small robot could press them and name the ones that failed.
Daily List is a to-do list app. Tom, the tester, checks add-a-task before every release. By hand it is slow. On a tired day he skips a step. Mei, the test lead, suggests a robot for the browser.
What it is: Playwright is a library that drives a real browser from code you write. This topic is the whole tool, and later lessons are slices such as locators. It drives the browser engines Chromium, Firefox, and WebKit on its own link. Selenium uses a , and Cypress runs inside the browser. runs the tests, including in a headless browser with no window.
Why it matters: Without this robot, Tom repeats the same clicks by hand and skips a step on a tired day. Auto-waiting holds each click until the button is ready, so a slow paint does not look like a bug. One script can run on all three engines before Mei signs off a release.
The robot only checks what Tom wrote down. It cannot say that a label is confusing or that the page looks wrong.
(SYNTHETIC / TRAINING ONLY: Daily List, its test site, and every person named here are made up.)
PLAIN WORDS · 6 in this section
- playwright
- a free Microsoft tool that drives a browser for tests
- chromium
- the open-source browser engine behind Google Chrome
- webkit
- The browser engine behind Safari. Playwright can drive it.
- selenium
- A free tool that drives a web browser for checks.
- cypress
- A free tool that drives a web browser for checks.
- headless
- Without a visible window.
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 Seeing what a real browser does when a script presses the buttons, and having a robot repeat that check on demand.
- Write the steps
- Run the robot
- Read the report
- Fix the failure
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The television | The browser engine that draws the page |
| The remote-control robot | Playwright |
| The list of buttons to press | The test code |
| The robot's report of which buttons failed | The test results |
WHERE THIS PICTURE STOPS
- A robot has no eyes. Playwright checks only what the test asks it to check.
- A television has one fixed set of buttons. A web page can change as you use it, so the robot must wait until things are ready.
- A robot does not decide which buttons matter. A tester does.
HOOK
A robot that presses and reports.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
If you press the same buttons by hand before every release, let Playwright repeat them and say which step failed.
| In the trick | What it stands for |
|---|---|
| Same buttons by hand | slow, and on a tired day Tom skips a step |
| Playwright repeats them | One script can run on all three engines |
The robot has no eyes, so it checks only what the test tells it to check.
TELL A FRIEND
A robot presses the buttons on a television remote for you and tells you which ones failed.
OFTEN MIXED UP WITH Automation frameworks overview. The frameworks lesson explains how automated tests are organised in general. This lesson names one tool and shows how it drives a browser.
Sources & standards — 5 sources
- Market practice
Installation (Playwright documentation) ↗ — Microsoft (Playwright) · Installation / intro: actual setup prompts, generated config/tests, selected browser projects, reports and version-matched browser installation reviewed 6 November 2026. Current source supports Node 22/24/26 lines; no claim that every platform/scaffold option was executed.
Actual complete Installation/intro article inspected during Phase 1 on 6 November 2026, including setup prompts, generated files, selected projects, reports and browser update/install contract. Source inspection is not a claim that every scaffold command, supported operating system or version was executed. Documentation licence CC BY 4.0 was separately reviewed; version and local-execution limits are in the v45 audit.
- 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) · Test user-visible behaviour, keep tests isolated, prefer role and text locators over fragile selectors, and use web-first assertions (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
Browsers (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
Supported languages (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.
PRACTISE AND KEEP
Sources for this topic — 5 sources
- Market practice
Installation (Playwright documentation) ↗ — Microsoft (Playwright) · Installation / intro: actual setup prompts, generated config/tests, selected browser projects, reports and version-matched browser installation reviewed 6 November 2026. Current source supports Node 22/24/26 lines; no claim that every platform/scaffold option was executed.
Actual complete Installation/intro article inspected during Phase 1 on 6 November 2026, including setup prompts, generated files, selected projects, reports and browser update/install contract. Source inspection is not a claim that every scaffold command, supported operating system or version was executed. Documentation licence CC BY 4.0 was separately reviewed; version and local-execution limits are in the v45 audit.
- 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) · Test user-visible behaviour, keep tests isolated, prefer role and text locators over fragile selectors, and use web-first assertions (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
Browsers (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
Supported languages (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.
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.