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

If WebdriverIO opens a visible Chrome window, put the headless flag in the Chrome capability that actually creates your session. Use browserName: 'chrome' and goog:chromeOptions.args; for example, args: ['headless', 'disable-gpu']. If the test still needs a Linux display server, run it through Xvfb instead of assuming Xvfb itself enables native headless mode.

1. Put the flag in the active Chrome capability

WebdriverIO passes Chrome-specific startup arguments through the goog:chromeOptions capability extension. A minimal configuration is:

export const config = {
  capabilities: [{
    browserName: 'chrome',
    'goog:chromeOptions': {
      args: ['headless']
    }
  }]
};

The capabilities guide also shows disable-gpu alongside headless:

capabilities: [{
  browserName: 'chrome',
  'goog:chromeOptions': {
    args: ['headless', 'disable-gpu']
  }
}]

Use the capability object selected by your runner. A correctly written option in an unused capability, a local-only branch, or a second configuration file has no effect on the session that is running.

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.
#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works

See WebdriverIO’s capabilities documentation for the current capability format.

2. Make conditional CI configuration observable

Many projects add headless arguments only in continuous integration. Check both sides of that condition and print the final capabilities before the session starts.

const chromeArgs = process.env.CI
  ? ['headless', 'disable-gpu']
  : [];

export const config = {
  capabilities: [{
    browserName: 'chrome',
    'goog:chromeOptions': { args: chromeArgs }
  }]
};

console.log('Chrome arguments:', chromeArgs);

If CI is set to a non-empty value in your environment, this example supplies headless mode. If your project uses a different variable, profile, or imported capability, inspect that exact path. WebdriverIO’s setup guidance includes conditionally applying these arguments for CI; the important point is that the selected session capability contains them.

What to verify in the running session

  • browserName is exactly 'chrome'.
  • The key is exactly 'goog:chromeOptions', including capitalization and the colon.
  • args is an array, not a single space-separated string.
  • The array contains headless or the explicit --headless=new form.
  • The capability is on the session that your test runner starts, rather than on a profile that is never selected.

3. Check flag spelling and placement

Chrome arguments belong inside goog:chromeOptions.args. Do not put headless at the top level of the capability or under an unrelated vendor key. WebdriverIO’s examples use the bare argument headless; its Xvfb example uses --headless=new. Both forms communicate the intended Chrome mode in the documented configurations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
// Explicit form used in WebdriverIO's Xvfb example
capabilities: [{
  browserName: 'chrome',
  'goog:chromeOptions': {
    args: ['--headless=new', '--no-sandbox']
  }
}]

--no-sandbox is shown here because it appears in the Xvfb configuration example. Treat it as an environment-specific setting, not a universal fix: changing sandboxing has security implications and should follow the container or host setup you use.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Do not accidentally overwrite the options object

Configuration merges can silently replace an earlier argument array:

// Risky: the second assignment replaces the first args array
const chromeOptions = { args: ['headless'] };
Object.assign(chromeOptions, { args: ['window-size=1440,900'] });

Combine arguments in one final array or merge arrays deliberately:

const chromeOptions = {
  args: ['headless', 'disable-gpu', 'window-size=1440,900']
};

4. Understand Chrome’s current headless implementation

Chrome’s unified headless mode is enabled with --headless. Chrome updated the implementation in version 112: Chrome can create platform windows internally while not displaying them to the user. That behavior is still headless even though internal window creation differs from older releases.

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

Chrome also documents that the old headless implementation is available only as the standalone chrome-headless-shell binary starting with Chrome 132.0.6793.0. Therefore, do not diagnose a visible window by assuming that every Chrome version uses the old implementation or that a legacy shell switch is required. Check the Chrome binary installed in the runner and the arguments WebdriverIO actually passes.

See Chrome Headless mode (updated 2024-10-21 UTC) for Chrome’s mode description and version history.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

5. Decide between native headless and Xvfb

Approach Use it when What it provides
Native Chrome headless Your tests do not require a display server, window manager, desktop environment, or GLX behavior. Chrome runs unattended without a visible UI. WebdriverIO recommends this where possible.
Xvfb-backed execution Linux tooling expects DISPLAY, or behavior depends on a window manager, desktop environment, or GLX. A virtual display for software that requires display-server semantics; it does not itself turn on Chrome’s native headless mode.

WebdriverIO describes Xvfb as a virtual display option for cases that need a display server or desktop-dependent behavior. If your test only needs an invisible browser, start with native headless. If a library fails because DISPLAY is missing, or rendering relies on GLX or a window manager, use the Xvfb setup documented by WebdriverIO.

Read Headless & Xvfb with the Testrunner for the supported setup patterns.

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

Typical Xvfb capability

capabilities: [{
  browserName: 'chrome',
  'goog:chromeOptions': {
    args: ['--headless=new', '--no-sandbox']
  }
}]

This capability is only one part of an Xvfb run. The process must also start Xvfb and expose its display to the test process according to your Linux runner. Follow the WebdriverIO instructions for starting and exporting the virtual display; do not infer a universal command from the capability alone.

6. Docker and CI checks

Containers add independent failure points: the Chrome binary may differ from the local machine, the session may use another configuration file, and a display service may not be installed. WebdriverIO’s Docker guide covers configuring Chrome capabilities in its container setup. Apply that guidance to the image and runtime you actually use rather than copying a recipe intended for a different image.

  1. Print the Chrome version inside the container.
  2. Print the resolved WebdriverIO capabilities immediately before session creation.
  3. Confirm the same configuration file is loaded in the container and locally.
  4. Check whether the runner expects DISPLAY. If it does, provide Xvfb or remove that dependency.
  5. Capture the session startup logs so you can compare the requested arguments with the browser process that launches.

WebdriverIO’s setup types documentation can help you identify which runner setup is constructing the session when a project has multiple entry points.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

7. A troubleshooting sequence that isolates the cause

Symptom: Chrome opens a visible window

  1. Inspect the final capability object, not the source fragment where you first defined it.
  2. Confirm that the active capability contains browserName: 'chrome' and goog:chromeOptions.args with headless or --headless=new.
  3. Check conditional CI logic, profile selection, and configuration imports.
  4. Look for a later merge that replaces args.
  5. Compare browser startup logs with the requested arguments. If the flag is present but the behavior remains unexpected, investigate how the project creates its session and which Chrome binary it launches; that is a project-specific diagnosis, not proof of one universal cause.

Symptom: “no DISPLAY environment variable” or display connection errors

This usually indicates that some part of the stack expects a display server. Either remove that desktop dependency and use native headless, or configure Xvfb for the Linux process. Native headless and Xvfb solve different requirements.

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.

Symptom: Chrome exits immediately in a container

Verify the image’s Chrome installation, the selected capability, and container-specific permissions. WebdriverIO’s Docker documentation is the appropriate reference for its supported container setup. Avoid adding unrelated flags until you have confirmed which requirement is failing.

Symptom: The option appears ignored

Check for a typo in goog:chromeOptions, a non-array args value, an overwritten options object, or a capability that is never selected. Also confirm that the runner is starting Chrome rather than another browser capability.

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

8. Verify the fix with a minimal session

Reduce the configuration to one Chrome capability and one test. This removes framework hooks and additional profiles from the diagnosis.

export const config = {
  capabilities: [{
    browserName: 'chrome',
    'goog:chromeOptions': {
      args: ['headless', 'disable-gpu']
    }
  }],
  specs: ['./test/specs/headless.e2e.js']
};

Run the smallest test that opens a known page and records a screenshot or page title. If this minimal session is headless, reintroduce project hooks one at a time until the configuration that changes the behavior is identified.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video

Or skip the browser setup

If your goal is a clean page image rather than an interactive WebdriverIO session, ScreenshotNeo returns a screenshot from one GET request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or 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. It also provides an MCP server for AI agents such as Claude and Cursor, with take_screenshot, get_page_info, and capture_pdf tools.

Use the API from the ScreenshotNeo documentation:

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)
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}`);

ScreenshotNeo includes full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, PDF output, custom CSS and JavaScript, click and wait controls, request blocking, headers, cookies, user agent, authorization, timezone, geolocation, transparent backgrounds, resizing, configurable caching, signed links, async jobs with webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Existing parameter names used by other screenshot APIs also work.

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account to start without a card.

9. Practical reliability and cost considerations

  • Native headless avoids maintaining a virtual display when your tests do not need one.
  • Xvfb adds a display-server dependency but can support software that requires DISPLAY, GLX, or desktop behavior.
  • Chrome and WebdriverIO versions in CI can differ from local versions; record both when a failure is environment-specific.
  • For repeated static captures, an API with caching can avoid launching a browser process for every request; ScreenshotNeo lets you choose a cache TTL and reports whether a response was billed.

Frequently Asked Questions

Does Xvfb make Chrome headless?

No. Xvfb supplies a virtual display. Chrome still needs a headless argument if you want native headless mode; use Xvfb when another component requires display-server behavior.

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

Should I use `headless` or `–headless=new`?

WebdriverIO documents `headless` in its capabilities example and `–headless=new` in its Xvfb example. Use the form appropriate to the configuration you are following and verify the resulting session arguments.

Where can I check Chrome’s headless version behavior?

Chrome’s official headless documentation explains the implementation update in Chrome 112 and the standalone `chrome-headless-shell` change beginning with Chrome 132.0.6793.0.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.90
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
Bestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.99

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.