TOPIC 50/6018 MINNOT STARTED

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.

  1. Get the address
  2. Set connect options
  3. Run the test
  4. Read the result
Same test, borrowed browser

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The shared labThe remote browser or cloud grid
Booking a benchGetting a web socket address from a provider
The experiment you bringThe test code, which stays the same
The long trip to the labThe 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.

What each part of the trick stands for
In the trickWhat it stands for
linka dropped connection
tunnelreaching your private site
versionmatching 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
  1. 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.

    Separates library use from the Playwright Test runner. Vendor documentation, 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.

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

    Describes connect, launchServer, wsEndpoint and the version match rule. Vendor documentation, not a standard. · Checked 2026-11-06

    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.

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

    Describes connectOptions in the test config. Vendor documentation, not a standard. · Checked 2026-11-06

    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.

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

    Describes running a Playwright server in a container and connecting to it. Vendor documentation, 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

    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.

    Says Selenium Grid support is experimental, is switched on by pointing SELENIUM_REMOTE_URL at the hub, and works for Chromium-based browsers such as Chrome and Edge only. Vendor documentation, 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.

PRACTISE AND KEEP

Sources for this topic — 5 sources
  1. 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.

    Separates library use from the Playwright Test runner. Vendor documentation, 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.

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

    Describes connect, launchServer, wsEndpoint and the version match rule. Vendor documentation, not a standard. · Checked 2026-11-06

    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.

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

    Describes connectOptions in the test config. Vendor documentation, not a standard. · Checked 2026-11-06

    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.

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

    Describes running a Playwright server in a container and connecting to it. Vendor documentation, 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

    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.

    Says Selenium Grid support is experimental, is switched on by pointing SELENIUM_REMOTE_URL at the hub, and works for Chromium-based browsers such as Chrome and Edge only. Vendor documentation, 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.

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.