Remote browsers, cloud grids and library mode
Run Playwright tests in a browser that lives on another machine, such as a cloud grid, and learn when to use Playwright as a plain library instead of the test runner.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: booking a bench in a shared lab. A teacher wants twenty kinds of soil. Buying them all is slow and costly. She books a bench in a shared lab, does the experiment, and goes home.
Tom tests Daily List, a to-do list app. His laptop has one browser. Mei, the test lead, wants the same tests on more browsers and systems than that laptop holds.
What it is: Playwright is a free program, made by Microsoft, that drives real web browsers from test code. A is a browser on another machine. Your test stays on your computer, and each step travels across the network. A is a service that rents many of those browsers. It is one kind of device cloud, a rented pool of machines. Playwright Test is the test runner that finds tests, runs them and writes the report. Library mode means using the playwright package as a plain library, with no runner. Do not mix a remote browser with library mode. One is where the browser lives. The other is how you start the script.
Why it matters: one laptop cannot hold every browser Daily List must support. A grid lets Tom borrow them. lets Leo, the developer, drive a browser from a script that is not a test, such as a nightly picture.
A remote connection adds network overhead; overall suite duration also depends on capacity and parallelism, so it is not necessarily slower in total. The remote browser is often a , a browser with no window. It also cannot see a private site unless you open a path.
Kept simple: most end-to-end tests should stay on . Library mode is for scripts that are not tests.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named here are invented.)
PLAIN WORDS · 2 in this section
- playwright
- a free Microsoft tool that drives a browser for tests
- 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 Running a test in a browser that lives somewhere else, and knowing what that costs.
- Get the address
- Set connect options
- Run the test
- Read the result
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The shared lab | The remote browser or cloud grid |
| Booking a bench | Getting a web socket address from a provider |
| The experiment you bring | The test code, which stays the same |
| The long trip to the lab | The delay of each step crossing a network |
WHERE THIS PICTURE STOPS
- A lab is a place you walk to. A remote browser is reached over a connection, so a dropped link can look like a failing test.
- A shared lab has rules about what you may bring in. A cloud browser cannot see your private site unless a tunnel is set up.
- A lab does not care about version numbers. A remote browser needs matching Playwright versions on both sides.
HOOK
Same test, borrowed browser.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
Same test, borrowed browser. If a remote run fails oddly, usually check the link, the tunnel and the version first.
| In the trick | What it stands for |
|---|---|
| link | a dropped connection |
| tunnel | reaching your private site |
| version | matching Playwright on both sides |
A real test failure can also look like a network problem, so read the error.
TELL A FRIEND
It is like booking a bench in a shared lab: your experiment stays the same and only the place changes.
OFTEN MIXED UP WITH Playwright, Selenium and Cypress: choosing a tool. The comparison lesson helps you choose a tool. This lesson is about where the chosen tool's browser lives.
Sources & standards — 5 sources
- Market practice
Library (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
BrowserType (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: connect, connectOverCDP, launch and launchServer (persistent-option middle not fully read). 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: connect, connectOverCDP, launch and launchServer (persistent-option middle not fully read). 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
TestOptions (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: trace/video attempt retention. 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: trace/video attempt retention. 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
Docker (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
Selenium Grid (experimental) (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
Library (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
BrowserType (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: connect, connectOverCDP, launch and launchServer (persistent-option middle not fully read). 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: connect, connectOverCDP, launch and launchServer (persistent-option middle not fully read). 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
TestOptions (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: trace/video attempt retention. 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: trace/video attempt retention. 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
Docker (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
Selenium Grid (experimental) (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.