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.

Headless mode runs a browser without displaying its normal window. An automation tool still launches a real browser, navigates pages, clicks controls, submits forms, captures screenshots, and checks results. The difference is that the browser’s user interface is not shown on screen, which makes headless execution practical on servers, containers, and continuous-integration (CI) workers.

Headless is an execution mode, not a promise that every run behaves exactly like every visible (headed) run. The browser engine, build, channel, operating system, graphics stack, and framework settings can all affect results.

What headless mode means

In a headed run, a browser window is available for a person to watch. In a headless run, the browser operates without that visible window. Your test code still controls pages through an automation framework or driver such as Playwright, Puppeteer, Selenium, or WebDriver.

Chrome for Developers describes Chrome Headless as running Chrome in an unattended environment without a visible user interface. A headless process can still load JavaScript, maintain cookies and storage, make network requests, render CSS, and execute the same test assertions as an interactive run.

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

“Headless” therefore describes visibility, not a separate testing methodology. You can run end-to-end tests, visual checks, accessibility checks, PDF generation, or scripted browser tasks in either mode.

Why teams use headless browsers

Unattended CI and servers

Build agents and containers commonly have no desktop session. Headless Chrome can run there without a monitor, window manager, or human login. A pipeline can install a pinned browser, execute tests, save artifacts, and exit with a pass or fail status.

Repeatable automation

A test suite can launch the browser with known arguments and a controlled viewport. This avoids relying on whichever window happens to be open on a developer’s desktop.

Artifacts beyond assertions

Headless Chrome supports screenshots, PDF output, remote debugging, and virtual-screen configuration. A failed test can therefore preserve a screenshot, trace, console log, or video for later diagnosis even though nobody watched the run live.

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

Resource and operational constraints

Removing the visible window simplifies operation in containers and remote machines. It does not eliminate the need to provision CPU, memory, fonts, browser binaries, shared libraries, or a suitable sandbox configuration.

Headless is not always identical to headed

Implementation details matter. Modern Chrome Headless shares the browser implementation used by headful Chrome. Playwright’s default Chromium headless setup can instead use a separate Chromium headless shell, while the chromium channel opts into the newer mode. Playwright warns that behavior can differ between these configurations.

That distinction explains why a test may pass in one configuration and fail in another without any application change. Rendering differences, available codecs, GPU behavior, fonts, viewport defaults, sandboxing, and browser-version drift can all contribute.

Configuration What it means When to choose it
Chrome Headless Chrome’s unattended mode using the modern Chrome implementation. Automated Chrome coverage on servers, containers, or CI.
Playwright default Chromium headless Playwright’s default headless launch may use its Chromium headless shell. Fast, framework-managed Playwright test runs when that implementation matches your target.
Playwright chromium channel Uses the newer Chromium headless implementation documented by Playwright. When you need behavior closer to current branded Chrome.
Headed Chromium, Firefox, WebKit, Chrome, or Edge A visible browser process, with engine and channel chosen by the framework. Interactive debugging or regression checks against a specific public browser.

Playwright supports Chromium, Firefox, and WebKit, plus branded Google Chrome and Microsoft Edge channels. Current Chromium is a common default; stable branded channels can matter when you test publicly distributed browsers or media codecs.

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

Headless versus headed testing

Concern Headless Headed
Window visibility No browser window is shown. A browser window is displayed.
Typical environment CI worker, container, server, scheduled job. Developer workstation or a CI machine configured with a virtual display.
Automation Fully scriptable through the same frameworks and drivers. Also scriptable; a person can observe the run.
Debugging Use screenshots, traces, logs, remote debugging, or artifacts. Watch the page and inspect it directly while the test runs.
Linux CI requirement Usually no X display is needed. Requires an X server; Playwright documents Xvfb for Linux agents.

Use headed mode when seeing the exact browser state is the fastest way to understand a failure. Use headless mode for normal unattended execution, then rerun a failing case headed or collect artifacts when necessary.

Running a headless test with Playwright

JavaScript

Playwright launches headlessly by default. This example checks a page title and saves an artifact:

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto('https://example.com', { waitUntil: 'networkidle' });
console.log(await page.title());
await page.screenshot({ path: 'example.png', fullPage: true });
await browser.close();

To inspect the same flow in a visible window, launch with headless: false:

const browser = await chromium.launch({ headless: false });

On a Linux CI agent, headed execution needs a display. Playwright’s documented pattern is to run the command through Xvfb:

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

Python

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True)
    page = browser.new_page(viewport={"width": 1440, "height": 900})
    page.goto("https://example.com", wait_until="networkidle")
    print(page.title())
    page.screenshot(path="example.png", full_page=True)
    browser.close()

Choosing a browser channel

When your compatibility target is branded Chrome or Edge, configure the corresponding Playwright channel rather than assuming the bundled Chromium build is equivalent. Pin browser versions in CI so a browser update does not silently change rendering or APIs.

Chrome Headless with a driver

Chrome documents automation through Puppeteer and ChromeDriver/WebDriver. Puppeteer downloads a compatible Chrome for Testing binary and launches Headless mode by default. A WebDriver-based framework can pair with Chrome for Testing and pass the --headless flag.

Keep the browser and driver versions compatible, and record the exact versions in CI logs. In containers, follow your platform’s guidance for the Chrome sandbox; disabling security features blindly can create risk.

Headless testing workflow in CI

  1. Pin the browser. Install a known Chrome for Testing, Chromium, Firefox, WebKit, Chrome, or Edge version appropriate to your test target.
  2. Install framework dependencies. For Playwright, install the browser binaries and Linux dependencies during image or job setup.
  3. Set deterministic conditions. Fix the viewport, timezone, locale, color scheme, permissions, test data, and network dependencies that affect results.
  4. Run headlessly by default. Save screenshots, traces, console output, and test reports on failure.
  5. Retry selectively. A retry can reveal a transient network problem, but do not hide real flakiness with unlimited retries.
  6. Reproduce visibly when needed. Run the same test with headless: false; on Linux, wrap it with xvfb-run.

For Playwright browser-launch diagnostics, set DEBUG=pw:browser in the job environment. This exposes launch details without requiring a visible window.

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

Common problems and fixes

“Browser closed unexpectedly”

Check that the browser binary, driver, and framework versions are compatible. Verify that required Linux libraries are installed and that the container has enough memory. Preserve the launch log and try the same version locally.

“Executable doesn’t exist”

The framework may be installed without its browser binaries. Run the framework’s browser-install command during image construction, or point the driver at an explicitly installed browser.

Headed mode fails with a display error

Linux headed runs need an X display. Start a desktop session or use xvfb-run -a. Headless mode avoids that display requirement.

Different layout or screenshots

Compare browser implementation and channel first: Playwright’s headless shell and newer Chromium mode are not guaranteed to render identically. Then compare viewport, device scale factor, fonts, operating-system packages, timezone, locale, and reduced-motion settings.

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

Tests hang on navigation

Set explicit navigation and assertion timeouts, wait for a meaningful selector instead of an indefinitely quiet network, and capture a trace on timeout. Third-party analytics, long-polling, and WebSockets can prevent a global “network idle” condition from being reached.

Bot checks or CAPTCHA interrupt the flow

Treat the challenge as an application or environment condition, not as proof that headless mode is broken. Use a test environment or approved test credentials; do not attempt to bypass access controls.

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

Performance, reliability, and coverage decisions

Performance

Headless can simplify scheduling and artifact collection, but no universal speed percentage applies. Runtime depends on browser version, page weight, concurrency, CPU, memory, network, and whether tests share a browser context. Measure your own suite rather than assuming that headless is always faster.

Reliability

Reliability comes from controlled inputs: pinned binaries, stable test data, explicit waits, isolated contexts, and reproducible containers. A headless run can still fail because of DNS, TLS, authentication, application defects, resource limits, or timing races.

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

Cross-browser coverage

Chrome Headless verifies Chrome behavior. It does not replace testing Firefox, WebKit, or branded Edge when those browsers are part of your support matrix. Use the framework’s engine and channel options to align each job with a real user target.

Or skip the browser setup

If your goal is a clean website image rather than an interactive test, ScreenshotNeo provides a website screenshot API and MCP server. It accepts a URL and returns PNG, JPEG, WebP, or PDF. Before capture, it can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off.

Only clean shots are billed. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and whether it was billed. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

For a one-call capture, see the ScreenshotNeo documentation and use:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The same request in Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

And Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo includes full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets plus custom viewports, retina scale, PDF paper and page-range controls, custom CSS and JavaScript, clicks, selector or network-idle waits, request and resource blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, selectable cache TTLs, signed links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, usage reporting, an OpenAPI specification, and familiar parameter names for easier migration.

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Sign up for the free ScreenshotNeo plan.

Frequently asked questions

Frequently Asked Questions

Does headless mode run JavaScript?

Yes. A headless browser executes page JavaScript just as an automated headed browser does; failures can still result from browser implementation, timing, permissions, or environment differences.

Can a headless test access DevTools?

You cannot see a normal DevTools window, but Chrome Headless supports remote debugging and automation frameworks can collect logs, traces, screenshots, and other artifacts.

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

Should production monitoring use headless mode?

It can, especially for scripted checks on servers. Choose the browser engine and channel that match the user experience you need to monitor, and define timeouts and alert thresholds explicitly.

Is Xvfb required for every CI browser test?

No. It is needed for headed execution on Linux without a physical display. A truly headless run normally does not need Xvfb.

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.