#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
Playwright Interview Q&A · #29

Can Playwright run on cloud-based services?

By Uncodemy Editorial Team · Updated 16 Nov 2026

Yes. Playwright tests are ordinary Node.js processes that drive browsers, so anything that can run Node and a browser can run them: a CI runner, a Docker container on a cloud VM, a Kubernetes job, or a hosted grid of remote browsers. "Running in the cloud" usually means one of three set-ups, and they differ in where the browsers live.

Option 1: tests and browsers on a CI runner

This is the most common set-up. The CI machine checks out your code, installs Playwright and its browsers, and runs the tests headless. A minimal GitHub Actions job looks like this:

# .github/workflows/e2e.yml
name: e2e
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx playwright test
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: playwright-report
          path: playwright-report/

--with-deps installs the Linux system libraries the browsers need. Without it you get errors about missing shared libraries on a fresh image. Jenkins, GitLab CI and Azure Pipelines follow the same steps; see integrating Playwright with CI/CD tools.

Option 2: the official Docker image

Microsoft publishes a Docker image with Node, the browsers and their dependencies already installed, on mcr.microsoft.com/playwright. Pin the tag to the same version as @playwright/test in your package.json:

docker run --rm --ipc=host -v "$PWD":/work -w /work \
  mcr.microsoft.com/playwright:v1.64.0-noble \
  npx playwright test

The same image runs on any cloud container service. --ipc=host is recommended for Chromium, which can run out of shared memory inside a container otherwise.

Option 3: remote browsers

Here the test runner stays on your machine or CI, but the browsers run somewhere else and the runner connects to them over a WebSocket. Playwright ships a small server for this:

# on the browser machine
npx playwright run-server --port 3000
// playwright.config.ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    connectOptions: {
      wsEndpoint: process.env.PW_WS_ENDPOINT ?? 'ws://browser-host:3000/',
    },
  },
});

Hosted browser grids from several testing vendors, and a Microsoft-run service on Azure, work on the same idea: you get a WebSocket endpoint and an access token, and you put them in connectOptions (often through the vendor's own config helper). Check each provider's current documentation for supported browsers, versions and limits, because these change often.

Scaling out with sharding

When one machine is not enough, split the suite across several CI jobs:

npx playwright test --shard=1/4   # job 1
npx playwright test --shard=2/4   # job 2 ... and so on

Use the blob reporter in each shard and npx playwright merge-reports afterwards to get one HTML report. Within each machine, workers still run in parallel; see parallelism in Playwright.

Gotchas in the cloud

Previous question: beforeAll and afterAll hooks.

Want to master Playwright hands-on?

Join Uncodemy's Playwright Automation Testing Course in Noida — Dedicated Placement Support.

Explore the Course →