Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Playwright runs test files in parallel by default. To test several browsers or device profiles, define named projects; to run tests within a file concurrently, enable fullyParallel or configure a group with test.describe.configure({ mode: 'parallel' }). In CI, split the suite across machines with --shard=x/y.

The safe configuration depends on isolation and capacity. Workers are independent operating-system processes, each with its own browser, but they can still collide through shared accounts, database rows, files, queues or third-party services. Set a worker limit that your CPU and memory can sustain, generate unique test data, and shard only after the suite is reliable on one machine.

Understand Playwright’s parallel execution model

What happens with the default configuration

Playwright Test distributes test files among worker processes. Tests in one file run in order in the same worker unless you explicitly enable parallel mode. Each worker is an independent OS process and starts its own browser, so a suite with many files can use several browsers without any special configuration.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Browser contexts provide isolation inside a worker, but process isolation does not protect shared application state. Two workers can still update the same customer, consume the same queue message, overwrite one file or hit a rate limit at the same time. Treat backend records and external services as shared resources even when the browser contexts are isolated.

#1 Best Overall
Sale
AMD RYZEN 7 9800X3D 8-Core, 16-Thread Desktop Processor
  • The world’s fastest gaming processor, built on AMD ‘Zen5’ technology and Next Gen 3D V-Cache.
  • 8 cores and 16 threads, delivering +~16% IPC uplift and great power efficiency
  • 96MB L3 cache with better thermal performance vs. previous gen and allowing higher clock speeds, up to 5.2GHz
  • Drop-in ready for proven Socket AM5 infrastructure
  • Cooler not included

The controls that change concurrency

Control Scope Effect
workers Whole test run Maximum number of concurrent worker processes. workers: 1 serializes execution.
fullyParallel: true All projects and files Allows individual tests, rather than only files, to be scheduled concurrently.
test.describe.configure({ mode: 'parallel' }) A file or describe group Enables test-level concurrency only where you opt in.
projects Browser, device or environment matrix Runs the configured project variants, subject to the worker limit.
--shard=x/y Multiple CI machines Assigns one portion of the suite to a particular machine.

These controls are independent. A project matrix multiplies the tests that must run; it does not automatically create unlimited workers. A shard is another copy of the run on a different machine, not a faster worker on the current machine.

Define browser and device projects

A project is a named configuration for a browser, device profile or environment. Playwright runs every configured project by default. Use --project when you want one project, for example while debugging a Firefox-only failure.

npx playwright test
npx playwright test --project=firefox

The following configuration creates a setup project and three desktop-browser projects. The browser projects depend on setup, so setup completes before they begin.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  fullyParallel: true,
  workers: process.env.CI ? 2 : undefined,
  projects: [
    { name: 'setup', testMatch: '**/*.setup.ts' },
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
      dependencies: ['setup'],
    },
    {
      name: 'firefox',
      use: { ...devices['Desktop Firefox'] },
      dependencies: ['setup'],
    },
    {
      name: 'webkit',
      use: { ...devices['Desktop Safari'] },
      dependencies: ['setup'],
    },
  ],
});

Choose project names that describe the tested environment, not the machine that happens to run it. You can add branded browsers, mobile emulation, different base URLs or authenticated environments using the same model. Keep project-specific fixtures and credentials in that project’s use settings so a run is reproducible.

Run one project while developing

Use the exact project name from the configuration:

npx playwright test --project=chromium
npx playwright test --project=webkit

Running one project is useful for a quick feedback loop; the normal CI command should include every project that your release policy requires.

Choose file-level or test-level parallelism

Keep the default when tests in a file share state

With the default mode, Playwright can run separate files at the same time while preserving the order of tests within each file. This is often the least risky starting point for suites that use a common fixture, a single account or a sequence of UI steps.

Enable all-test concurrency with fullyParallel

Set fullyParallel: true in the configuration, or pass the command-line switch for a one-off run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx playwright test --fully-parallel

In fully parallel mode, tests from the same file can land on different workers. Every test must therefore create or select its own data, avoid relying on another test’s order and clean up resources it owns. A test that passes only after a previous test has populated state is not ready for this mode.

Rank #2
Sale
AMD Ryzen 9 9950X3D 16-Core Processor
  • AMD Ryzen 9 9950X3D Gaming and Content Creation Processor
  • Max. Boost Clock : Up to 5.7 GHz; Base Clock: 4.3 GHz
  • Form Factor: Desktops , Boxed Processor
  • Architecture: Zen 5; Former Codename: Granite Ridge AM5

Parallelize only an independent group

For a gradual migration, scope parallel mode to a file or a describe block:

import { test, expect } from '@playwright/test';

test.describe.configure({ mode: 'parallel' });

test('creates a draft', async ({ page }) => {
  // independent setup and data
});

test('publishes a draft', async ({ page }) => {
  // independent setup and data
});

Leave stateful groups in the default ordered mode and move them to parallel mode only after their fixtures and data are independent.

Use dependency projects for setup and teardown

A setup project is a normal Playwright project whose tests must pass before dependent projects start. Once setup succeeds, the dependent browser projects can run in parallel under the worker limit. A teardown project, when configured for the dependency graph, runs after the dependent projects finish.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Typical setup work includes creating an authenticated storage state, seeding a known dataset or starting a test service. Do not put per-test data in a single setup record if workers will mutate it. Instead, have each test or worker derive a unique identifier from its worker and test context.

The --no-deps switch deliberately skips dependency projects. It is useful when you already have the required state and want to debug one dependent project, but it also means setup will not run:

npx playwright test --no-deps --project=chromium

Shard a suite across CI machines

Sharding divides one suite into separate jobs. For four machines, run the same command with a different shard number in each job:

npx playwright test --shard=1/4
npx playwright test --shard=2/4
npx playwright test --shard=3/4
npx playwright test --shard=4/4

Each job needs the same source revision, Playwright installation, environment variables and application endpoint. Publish each job’s report and artifacts, then merge or inspect them using your CI reporting workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How Playwright assigns work

With fullyParallel: true, sharding can balance at test level. Without fully parallel execution, the split is at file level, so a few very large files can make one shard much slower than the others. If shard durations are uneven, first look for oversized files and order-dependent groups; then consider enabling fully parallel mode for the independent parts of the suite.

Rank #3
Sale
AMD Ryzen 5 5500 6-Core, 12-Thread Unlocked Desktop Processor with Wraith Stealth Cooler
  • Can deliver fast 100 plus FPS performance in the world's most popular games, discrete graphics card required
  • 6 Cores and 12 processing threads, bundled with the AMD Wraith Stealth cooler
  • 4.2 GHz Max Boost, unlocked for overclocking, 19 MB cache, DDR4-3200 support
  • For the advanced Socket AM4 platform

Sharding and workers work together. A shard with workers: 2 can use up to two workers on its machine. Increasing both the shard count and the worker count multiplies browser processes, memory use and CI capacity requirements.

Make data safe for parallel workers

Generate unique records

Give each test its own user, order, project or other mutable record. Include a collision-resistant suffix rather than relying on a shared fixture name. If the application requires a small pool of accounts, allocate them by worker and prevent two workers from selecting the same account at once.

Protect resources that cannot be duplicated

Use a named lock for a singleton resource, or put the affected tests in a project with a lower worker count. Serializing one project is safer than serializing the entire suite when only one integration is non-shareable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not use workers as communication channels

Workers cannot communicate directly. Pass state through an external store designed for the test environment, or create it independently in each worker. Avoid temporary files with a fixed name and avoid a global “current user” record.

Decide how many workers to use

There is no universal worker count or guaranteed percentage speedup. The useful limit is the point before CPU saturation, memory pressure, browser startup failures, application throttling or data contention outweighs the benefit of another worker.

  1. Run the suite reliably with one worker and record its duration and failure rate.
  2. Increase workers gradually on a machine representative of CI.
  3. Watch CPU, memory, browser process count, service rate limits and test retries.
  4. Stop increasing when the run no longer gets faster or reliability declines.
  5. Use a lower cap for projects that access a shared resource.

A practical configuration often uses a small fixed CI cap and leaves local runs uncapped by setting workers: process.env.CI ? 2 : undefined. The value 2 is an example starting point, not a benchmark or recommendation for every runner.

Useful commands and what they change

Command Use it for
npx playwright test Run all configured projects with the configuration’s worker and parallel settings.
npx playwright test --project=firefox Run only the named project.
npx playwright test --workers=4 Override the maximum worker count for this invocation.
npx playwright test --fully-parallel Enable test-level scheduling for this invocation.
npx playwright test --shard=1/4 Run the first quarter of a four-way CI split.
npx playwright test --no-deps --project=chromium Debug a project without running its dependency projects.

Troubleshoot parallel runs

Tests pass alone but fail in a full run

This usually indicates shared state: the same account, record, file, queue message or external service is being used by multiple workers. Give each test unique data, add a lock around the singleton operation or lower the worker count for that project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

One shard takes much longer than the others

If fully parallel mode is off, large files stay together and can skew file-level shards. Split oversized files where the tests are genuinely independent, or enable fully parallel mode for those tests after removing order dependencies.

Rank #4
Sale
AMD Ryzen™ 5 9600X 6-Core, 12-Thread Unlocked Desktop Processor
  • Pure gaming performance with smooth 100+ FPS in the world's most popular games
  • 6 Cores and 12 processing threads, based on AMD "Zen 5" architecture
  • 5.4 GHz Max Boost, unlocked for overclocking, 38 MB cache, DDR5-5600 support
  • For the state-of-the-art Socket AM5 platform, can support PCIe 5.0 on select motherboards
  • Cooler not included

Setup did not run

Check that the dependent project lists the setup project in dependencies and that you did not pass --no-deps. A setup failure blocks its dependents, so fix the first setup error before diagnosing browser tests.

A project is missing from the results

Running with --project intentionally selects only that project. Remove the selector for a matrix run and verify that each project has a valid name and configuration.

The machine becomes unstable after raising workers

Reduce workers, then compare CPU and memory usage with the previous run. Browser processes, application containers and test services all need headroom. A smaller, reliable run is preferable to a nominally faster run that retries or times out.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fully parallel mode exposes order assumptions

Tests that read state created by another test must be rewritten as independent scenarios or kept in an ordered group. Do not “fix” the symptom with arbitrary delays; create the required state in the test or its fixture.

Performance, reliability and CI cost trade-offs

More workers can reduce elapsed time, while more shards can reduce wall-clock time further by using additional machines. Both also consume more CPU, memory, browser capacity and CI minutes. A four-shard example in documentation is a configuration example, not a measured speedup.

Optimize in this order: make tests independent, choose a worker cap that the machine sustains, then shard across machines. Keep retries and traces enabled according to your normal CI policy so that a faster run does not hide concurrency failures. Compare complete runs, including setup and artifact upload, rather than timing only the browser steps.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is to capture a rendered page rather than execute assertions, ScreenshotNeo provides a single website-screenshot API call. It accepts consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a page such as the Playwright documentation, the cURL call is:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://playwright.dev -o shot.webp

See the ScreenshotNeo API documentation for authentication, output formats and all options. The equivalent Python and Node.js requests are:

Best Value
Sale
AMD Ryzen 7 7800X3D 8-Core, 16-Thread Desktop Processor
  • Processor provides dependable and fast execution of tasks with maximum efficiency.Graphics Frequency : 2200 MHZ.Number of CPU Cores : 8. Maximum Operating Temperature (Tjmax) : 89°C.
  • Ryzen 7 product line processor for better usability and increased efficiency
  • 5 nm process technology for reliable performance with maximum productivity
  • Octa-core (8 Core) processor core allows multitasking with great reliability and fast processing speed
  • 8 MB L2 plus 96 MB L3 cache memory provides excellent hit rate in short access time enabling improved system performance
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://playwright.dev"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://playwright.dev' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo is not a replacement for Playwright’s assertions or browser test matrix. It is useful when you need a clean visual asset or a capture endpoint without maintaining browser setup. Its MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients. Other options include full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets, arbitrary viewports, retina scale, PDF paper and page-range controls, custom CSS or JavaScript, pre-capture clicks, selector hiding, selector/delay/network-idle waits, request and resource blocking, custom headers/cookies/user agents/Authorization, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Parameter names used by other screenshot APIs also work.

Plan Included shots Price
Free 1,000 per month No card
Starter 3,000 $5
Growth 15,000 $15
Pro 60,000 $39
Scale 250,000 $99
Business 1,000,000 $249

Every feature is available on every plan, and yearly billing provides two months free. Create a free ScreenshotNeo account to get 1,000 screenshots each month without a card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

FAQ

Does adding three projects create three times as many workers?

No. Projects add browser or environment runs to the workload; the configured worker limit still caps concurrent workers on that machine.

Can I run only one browser in a sharded job?

Yes. Combine --project=project-name with the shard command when a CI job is intentionally dedicated to one project. For the complete matrix, omit the project selector.

Should visual captures and functional tests use the same pipeline?

Not necessarily. Keep Playwright for assertions and interaction coverage; use a screenshot API when a clean, repeatable image or PDF is the actual deliverable.

Frequently Asked Questions

Does adding three projects create three times as many workers?

No. Projects add browser or environment runs to the workload; the configured worker limit still caps concurrent workers on that machine.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I run only one browser in a sharded job?

Yes. Combine --project=project-name with the shard command when a CI job is intentionally dedicated to one project.

Should visual captures and functional tests use the same pipeline?

Not necessarily. Keep Playwright for assertions and interaction coverage; use a screenshot API when a clean, repeatable image or PDF is the actual deliverable.

Quick Recap

SaleBestseller No. 1
AMD RYZEN 7 9800X3D 8-Core, 16-Thread Desktop Processor
AMD RYZEN 7 9800X3D 8-Core, 16-Thread Desktop Processor
8 cores and 16 threads, delivering +~16% IPC uplift and great power efficiency; Drop-in ready for proven Socket AM5 infrastructure
$444.00
SaleBestseller No. 2
AMD Ryzen 9 9950X3D 16-Core Processor
AMD Ryzen 9 9950X3D 16-Core Processor
AMD Ryzen 9 9950X3D Gaming and Content Creation Processor; Max. Boost Clock : Up to 5.7 GHz; Base Clock: 4.3 GHz
$657.95
SaleBestseller No. 3
AMD Ryzen 5 5500 6-Core, 12-Thread Unlocked Desktop Processor with Wraith Stealth Cooler
AMD Ryzen 5 5500 6-Core, 12-Thread Unlocked Desktop Processor with Wraith Stealth Cooler
6 Cores and 12 processing threads, bundled with the AMD Wraith Stealth cooler; 4.2 GHz Max Boost, unlocked for overclocking, 19 MB cache, DDR4-3200 support
$84.93
SaleBestseller No. 4
AMD Ryzen™ 5 9600X 6-Core, 12-Thread Unlocked Desktop Processor
AMD Ryzen™ 5 9600X 6-Core, 12-Thread Unlocked Desktop Processor
Pure gaming performance with smooth 100+ FPS in the world's most popular games; 6 Cores and 12 processing threads, based on AMD "Zen 5" architecture
$174.00
SaleBestseller No. 5
AMD Ryzen 7 7800X3D 8-Core, 16-Thread Desktop Processor
AMD Ryzen 7 7800X3D 8-Core, 16-Thread Desktop Processor
Ryzen 7 product line processor for better usability and increased efficiency; 5 nm process technology for reliable performance with maximum productivity
$327.49

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.