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

Playwright workers are independent test-runner processes. By default, Playwright Test schedules separate test files in parallel, while tests in the same file run in order in one worker. Each worker launches its own browser, and each test receives an isolated BrowserContext. Reliable concurrency comes from combining a sensible worker limit with strict isolation of accounts, records, files, and other external state.

What a Playwright worker does

A worker is an operating-system process managed by Playwright Test. Workers have identical environments, and each starts its own browser. Workers do not communicate with one another, so variables, objects, and in-memory caches created in one process are unavailable in another.

Playwright also creates a fresh BrowserContext for each test. That isolates cookies, local storage, and session state inside the browser, but it does not isolate records in your application database, a shared account, a filesystem directory, a queue, or any other backend resource. Two contexts can still edit the same server-side row at the same time.

Default scheduling

  • Test files are the default parallel unit.
  • Tests in one file run in order in a single worker unless you opt into parallel mode.
  • A worker is reused for multiple files when possible; a failed worker can be restarted.

This means a suite can already use multiple workers without any special test code. Concurrency within one file is a separate decision.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
ELEGOO UNO R3 Smart Robot Car Kit V4 with Camera, Compatible with Arduino
  • BUILD, CODE & DRIVE YOUR OWN ROBOT CAR: Turn coding, electronics and engineering into a working programmable robot car you can assemble, program and drive; ideal for weekend family projects, STEM classrooms, coding clubs, robotics lessons and maker challenges
  • EXPLORE FPV, LINE TRACKING & OBSTACLE AVOIDANCE: Control the robot with the ELEGOO app or IR remote, view live FPV video through the onboard camera, follow black lines, avoid obstacles with the ultrasonic sensor and explore multiple interactive driving modes
  • BEGINNER-FRIENDLY BUILD WITH GUIDED WIRING: Keyed XH2.54 connectors help reduce wiring mistakes, while the illustrated tutorial and example programs guide beginners step by step from chassis assembly and module connection to programming and the first successful run
  • GO BEYOND ASSEMBLY WITH CREATIVE CODING: Program with Arduino IDE to explore movement, sensors and control logic, then modify example code to create custom routes, reactions and robotics experiments that develop coding, problem-solving and engineering skills
  • COMPLETE RECHARGEABLE STEM ROBOTICS KIT: Includes an ELEGOO UNO R3 controller board, ESP32-WROVER-based camera and Wi-Fi module, line-tracking and ultrasonic sensors, motors, IR remote and a 2000 mAh rechargeable lithium-ion battery; recommended for ages 8+ with adult guidance for first-time builders

Set the worker limit

Set a global cap in playwright.config.ts or override it on the command line. The current TestConfig documentation describes a default of half the machine’s logical CPU cores. That is a default setting, not a guaranteed performance target; browser memory, application capacity, and CI limits determine the useful value for your suite.

import { defineConfig } from '@playwright/test';

export default defineConfig({
  workers: process.env.CI ? 2 : undefined,
  // workers: '50%', // percentage of logical CPU cores
  use: { baseURL: 'http://localhost:3000' },
});

Run with an explicit limit when diagnosing contention or testing a CI configuration:

npx playwright test --workers=1
npx playwright test --workers=4
npx playwright test --workers=50%

Choosing a cap

  1. Start with the documented default or a small explicit number.
  2. Observe CPU, memory, browser crashes, server throttling, database locks, and test retries.
  3. Increase gradually only when the environment remains stable.
  4. Use a lower CI cap when runners are shared or the system under test has strict rate or account limits.

Do not claim a fixed speedup from adding workers. More processes can shorten wall-clock time, but they also multiply browser memory, network traffic, and setup load.

Enable parallel tests inside a file deliberately

Use test.describe.configure when independent tests in one file should run concurrently:

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

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

test('creates a project', async ({ page }) => {
  await page.goto('/projects/new');
  await page.getByLabel('Name').fill(`project-${test.info().parallelIndex}`);
  await page.getByRole('button', { name: 'Create' }).click();
  await expect(page.getByText('Created')).toBeVisible();
});

test('searches projects', async ({ page }) => {
  await page.goto('/projects');
  await page.getByPlaceholder('Search').fill('demo');
  await expect(page.getByRole('main')).toContainText('demo');
});

For suite-wide behavior, use fullyParallel: true in configuration. Project-level parallel settings can provide a narrower scope. Parallel tests get separate fixtures and hooks; they cannot safely share mutable in-memory state. If ordering is required, keep the tests in one file without parallel mode or redesign them so each test stands alone.

Rank #2
ELEGOO Mega 2560 R3 Project The Most Complete Starter Kit with Tutorial
  • 35+ Guided Electronics Projects: Progress from LEDs and buttons to RFID access, real-time clocks, motion and distance sensing, environmental monitoring, motor control and interactive displays for STEM learning, coding clubs and maker projects
  • More I/O and Memory for Larger Builds: The MEGA 2560 R3 provides 54 digital I/O pins, including 15 PWM outputs, 16 analog inputs, 4 hardware serial ports and 256 KB flash for projects that combine more sensors, controls and displays
  • 200+ Components for Prototyping: Includes LCD1602, RC522 RFID, RTC, DHT11, HC-SR501 PIR, ultrasonic and water-level sensors, GY-521, MAX7219, keypad, joystick, rotary encoder, relay, SG90 servo, stepper motor, DC motor, breadboard and more
  • Learn, Modify and Create: Follow 35+ guided lessons with example code, then adjust sensor thresholds, timing, display text, motor behavior and control logic to turn structured exercises into access systems, monitors, alarms and interactive projects
  • Organized for Repeatable Learning: Pre-soldered modules, a solderless breadboard, storage case and small-parts box reduce setup time and keep sensors, LEDs, ICs, wires and other components easy to find between projects

Make external state collision-proof

Isolation is the main reliability rule. A new BrowserContext does not prevent two tests from deleting the same customer or writing the same email address.

Generate unique records

import { test as base } from '@playwright/test';

export const test = base.extend<{ userEmail: string }>({
  userEmail: async ({}, use, testInfo) => {
    const id = `${testInfo.project.name}-${testInfo.workerIndex}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
    await use(`pw-${id}@example.test`);
  },
});

Prefer a server-side factory or API fixture that creates and deletes data for the test. Include a test or worker identifier in names, slugs, and external keys. Never rely on a timestamp alone if parallel jobs can share a clock and namespace.

Use test-scoped paths

Write downloads, screenshots, traces, and exported files below a directory derived from testInfo.outputPath(). Do not let workers overwrite a fixed path such as artifacts/latest.png. Playwright’s output directory is designed to separate test results; preserve that separation in your own helper code.

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.

Lock genuinely shared resources

If a test must use one account, a singleton device, or a non-transactional database fixture, serialize that portion with an application-level lock or reduce the relevant worker count. A lock is preferable to silently allowing races. Keep the critical section short and release it in a fixture teardown.

Worker-scoped fixtures and worker identity

A worker-scoped fixture runs once per worker and is torn down when that worker exits. It is appropriate for a resource whose lifetime and reuse match the process: for example, provisioning one database schema, API client, or seeded account for all tests assigned to that worker.

Rank #3
Sillbird STEM Robot Building Kit with Remote Control Gifts for Boys 8-13
  • 🎁Ideal Gift for Kids & Teens: Celebrate child’s growing skills and important milestones with this 5-in-1 Programmable robot set. Whether for birthdays, holidays, or achievements, it’s the perfect gift that encourages learning and hands-on fun—a gift that grows with them
  • ✨STEM Educational Toys: The robot set for kids ages 8+ combines the fun of STEM learning. It encourages hands-on learning and early programming as they build, which can spark creativity and imagination and provide hours of screen-free play
  • 📱Flexible Dual Control Modes: Control the Robotic kit with the intuitive app (Bluetooth) or remote. Enjoy fun features like basic programming, path, and precise movement, exploring endless interactive play
  • 🔄 5-in-1 Buildable with Varying Difficulty: The Robot Kit with Progressive Difficulty! From simple robots to complex models, kids can build a robot, dinosaur, car, tank, and more. Adjustable head, arms, and tail allow for fun, playful poses. Perfect for kids 8-12 to develop skills step by step and ignite creativity
  • 🛠️Clear & Detailed Build Instructions: This robot kit includes 488 pieces, with clear, colorful step-by-step instructions to make assembly easy. Kids can build their own robots independently or with family, enjoying quality time together and a confidence-boosting building experience
import { test as base } from '@playwright/test';

type WorkerFixtures = { workerAccount: { email: string; password: string } };

export const test = base.extend<{}, WorkerFixtures>({
  workerAccount: [async ({}, use, workerInfo) => {
    const slot = workerInfo.parallelIndex;
    const account = {
      email: `e2e-worker-${slot}@example.test`,
      password: process.env.E2E_PASSWORD!,
    };
    await provisionAccount(account);
    await use(account);
    await deleteAccount(account);
  }, { scope: 'worker' }],
});

workerIndex identifies a particular worker process. parallelIndex identifies the concurrent slot and remains stable if Playwright restarts that slot’s worker. Use parallelIndex when assigning durable resources such as accounts; use workerIndex when you specifically need a unique process identity.

Authenticated tests

For tests that mutate server-side state, provision a separate account for each parallel worker. If authenticated tests only read data or operate on isolated records, a shared account may be acceptable. Store authentication state in worker- or test-specific files, not one mutable file that concurrent tests overwrite.

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

Projects, workers, and sharding solve different problems

Mechanism What it changes Typical use
Workers Processes running tests on one machine Use available CPU and memory while controlling contention
Projects Configuration matrix Chromium, Firefox, WebKit, devices, auth states, or environments
Project workers Concurrency cap for one project Keep a constrained browser or backend environment below the global limit
Sharding Suite distribution across machines Run separate portions in parallel CI jobs
fullyParallel Scheduling granularity Allow individual tests, rather than only files, to be distributed

A project can have its own workers limit even when the global cap is higher. Sharding does not remove the need for isolation: every machine and every worker can still touch the same backend.

import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  workers: 4,
  projects: [
    { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
    { name: 'mobile', use: { ...devices['iPhone 13'] }, workers: 2 },
  ],
});

Run a shard with:

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

Use a CI matrix to launch all four jobs. With fullyParallel, Playwright can balance at test granularity; without it, file-level distribution can leave one shard with more work than another.

A practical setup sequence

  1. Keep each test independently runnable and repeatable.
  2. Identify every shared backend row, account, file, queue, and third-party quota.
  3. Choose test- or worker-scoped setup based on resource lifetime.
  4. Set a conservative global worker cap.
  5. Set lower per-project limits for constrained environments.
  6. Use unique identifiers based on test and parallel slot.
  7. Run a single worker to distinguish product failures from races.
  8. Run the same selection repeatedly with tracing to expose cleanup or ordering defects.
  9. Add sharding only after one machine is isolated and stable.

Or skip the browser setup

If your goal is simply to capture a page image or PDF rather than exercise UI behavior, ScreenshotNeo provides a single HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server lets Claude, Cursor, and other MCP clients call take_screenshot, get_page_info, and capture_pdf.

See the ScreenshotNeo API documentation for all options, including full-page lazy-image loading, CSS-selector element capture, device and retina settings, custom CSS or JavaScript, clicks, waits, request blocking, cookies, headers, geolocation, PDF controls, signed links, asynchronous webhooks, bulk capture, caching, and usage reporting.

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.
Rank #4
Sale
Sillbird 12-in-1 Solar Robot Building Kit STEM Gift for Boys Ages 8-13
  • 🎁 Ideal Gift for Kids & Teens: This STEM solar robot kit celebrates child’s growing skills and important milestones. Whether for birthdays, holidays, it’s the perfect gift that grows with them and offers screen-free fun
  • 📚 STEM Educational Toy: This solar educational toy brings science to life! The fun DIY building experience sparks children's curiosity in engineering and renewable energy, while nurturing their problem-solving skills
  • ☀️ Powered by the Sun: Enjoy outdoor play with solar power or switch to a strong artificial light source indoors, such as a flashlight, ensuring uninterrupted play for children. This solar build bot toy encourages kids to have fun while exploring renewable energy
  • ⚡ Upgraded Larger Solar Panel: Features a large sun-catching surface to harvest more sunlight and deliver stronger power output. Kids discover renewable energy principles through play - a fun educational toy for ages 8+
  • 🤖 12-in-1 Buildable with Increasing Challenge: With 190 parts, kids can build 12 models like robots, cars, and more. From simple beginners to advanced builds, the varying difficulty levels allow it to grow with your child’s skills. Each robot sparks children’s creativity
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

The Free plan includes 1,000 screenshots each month without a card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to get an API key.

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

Troubleshooting worker failures

Tests pass with one worker but fail in parallel

Look for shared accounts, fixed filenames, reused record IDs, global variables, and tests that depend on execution order. Add unique data or serialization; do not merely increase retries.

Workers run out of memory or browsers crash

Lower workers, reduce heavy projects running simultaneously, and inspect traces for pages that remain open. More workers multiply browser memory.

Authentication is intermittent

Check that each worker has its own account or immutable storage-state file. A shared account that changes roles, carts, or settings will race even when BrowserContexts are isolated.

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

Shards finish at very different times

Use fullyParallel when test-level balancing is safe, or reorganize unusually large files. Keep shard counts aligned with available CI machines; sharding cannot compensate for a bottlenecked backend.

Best Value
Sale
Thames & Kosmos Mega Cyborg Hand STEM Experiment Kit | Build Your Own GIANT Hydraulic Amazing Gripping Capabilities Adjustable for Different Sizes Learn Pneumatic Systems
  • Build your own awesome, wearable mechanical hand that you operate with your own fingers.
  • No motors, no batteries — just the power of air pressure, water, and your own hands!
  • Hydraulic pistons enable the mechanical fingers to open and close and grip objects with enough force to lift them. Every finger joint can be adjusted to different angles for precision movement.
  • Three configurations: right hand, left hand, and claw-like; adjustable to fit virtually any human hand.
  • Learn how pneumatic and hydraulic systems are used in industrial robots such as automobile components..2021 The Toy Association's STEAM Toy Of The Year Winner

Worker fixture cleanup is incomplete

Ensure teardown runs in a finally-equivalent fixture lifecycle and that resource names include the stable parallel slot. Periodically remove abandoned resources from interrupted CI jobs.

Frequently Asked Questions

Can workers share a browser instance?

No. Workers are independent processes and each starts its own browser. Share backend services only when their data is designed for concurrent use.

Should every test have a separate account?

Only tests that mutate overlapping server-side state require separate accounts. Read-only or otherwise isolated tests can use a shared account if it cannot be changed by concurrent work.

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

Does sharding replace worker configuration?

No. Sharding distributes tests across machines; workers control concurrency inside each machine, and project limits can narrow it further.

The Bottom Line

Use workers to add controlled process-level concurrency, but treat external-state isolation as non-negotiable. Start with a conservative cap, choose fixture scope to match resource lifetime, use projects for coverage, and shard only after the suite is race-free on one machine.

Quick Recap

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.