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

Set Playwright’s launch option to the browser binary you want to run: executablePath in JavaScript or TypeScript, and executable_path in Python. For Playwright Test, put the same option inside use.launchOptions. A relative path is resolved from the process’s current working directory. Use a custom executable only when you need a particular installed browser; Playwright is designed and version-tested around its bundled browsers.

Set the path in JavaScript or TypeScript

Pass executablePath to the browser type’s launch() method. The option accepts a path to an executable that Playwright should launch instead of its bundled browser.

import { chromium } from 'playwright';

const browser = await chromium.launch({
  executablePath: '/opt/google/chrome/chrome',
  headless: true
});

const page = await browser.newPage();
await page.goto('https://example.com');
console.log(await page.title());
await browser.close();

Use the equivalent option with firefox.launch() or webkit.launch() when the file is a Firefox or WebKit executable:

import { firefox, webkit } from 'playwright';

const firefoxBrowser = await firefox.launch({
  executablePath: '/custom/firefox/firefox'
});
await firefoxBrowser.close();

const webkitBrowser = await webkit.launch({
  executablePath: '/custom/webkit/MiniBrowser'
});
await webkitBrowser.close();

Use an absolute path when possible

An absolute path avoids surprises when a service, test runner, or CI job starts in a different directory. If you intentionally use a relative path, Playwright resolves it against the current working directory of the Node.js process, not against the directory containing your source file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
import path from 'node:path';
import { chromium } from 'playwright';

const browserPath = path.resolve('browsers', 'chromium', 'chrome');
const browser = await chromium.launch({ executablePath: browserPath });
// ...
await browser.close();

On Windows, either use a correctly escaped string or a path helper:

import path from 'node:path';

const browserPath = path.join('C:', 'Program Files', 'Google', 'Chrome', 'Application', 'chrome.exe');

A path helper is preferable to manually mixing slash styles. The file must be executable by the account running Playwright.

TypeScript launch helper

import path from 'node:path';
import { chromium, type Browser } from 'playwright';

export async function startBrowser(): Promise<Browser> {
  const executablePath = path.resolve(process.env.BROWSER_BIN ?? '/usr/bin/chromium');
  return chromium.launch({ executablePath });
}

Keep the environment variable optional if local developers should use a known default. In deployment, set it to an absolute path that exists in that image or host.

Set the path in Python

Python uses the snake-case spelling executable_path. The option is available in both the synchronous and asynchronous APIs.

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

Synchronous API

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(
        executable_path="/opt/google/chrome/chrome",
        headless=True,
    )
    page = browser.new_page()
    page.goto("https://example.com")
    print(page.title())
    browser.close()

Asynchronous API

import asyncio
from playwright.async_api import async_playwright

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch(
            executable_path="/opt/google/chrome/chrome",
            headless=True,
        )
        page = await browser.new_page()
        await page.goto("https://example.com")
        print(await page.title())
        await browser.close()

asyncio.run(main())

Resolve a relative path explicitly

Python’s pathlib makes the base directory obvious:

from pathlib import Path
from playwright.sync_api import sync_playwright

browser_file = (Path.cwd() / "browsers" / "chrome").resolve()

with sync_playwright() as p:
    browser = p.chromium.launch(executable_path=str(browser_file))
    browser.close()

Converting the Path object to a string keeps the launch call clear and works consistently across supported Python versions.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Configure Playwright Test

Playwright Test does not require a separate browser-launch wrapper. Put launch options under use.launchOptions in playwright.config.ts:

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

export default defineConfig({
  use: {
    launchOptions: {
      executablePath: '/opt/google/chrome/chrome',
    },
  },
});

The nested object accepts the launch options supported by browserType.launch(). You can scope the setting to a project when only one browser configuration needs the custom binary:

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

export default defineConfig({
  projects: [
    {
      name: 'system-chrome',
      use: {
        browserName: 'chromium',
        launchOptions: {
          executablePath: process.env.BROWSER_BIN,
        },
      },
    },
    {
      name: 'bundled-firefox',
      use: { browserName: 'firefox' },
    },
  ],
});

Do not set an empty or undefined path accidentally. If the environment variable is absent, omit launchOptions.executablePath and let Playwright use its managed browser instead.

Choose the right setting

Three settings are often confused. They solve different problems:

Requirement Setting What it changes Important limitation
Launch a specific installed browser file executablePath (JavaScript/TypeScript) or executable_path (Python) Selects the executable for this launch Arbitrary browser builds may not match your Playwright version
Store Playwright-managed browser downloads elsewhere PLAYWRIGHT_BROWSERS_PATH Controls where Playwright installs and finds its managed binaries It does not select an arbitrary Chrome or Edge executable
Use a supported branded distribution channel, such as chrome, chrome-beta, or msedge Requests a named Chrome or Edge channel Compatibility still depends on the browser and Playwright versions

Bundled browser versus custom executable

The bundled Chromium, Firefox, or WebKit build is the reproducible default: Playwright releases are matched to specific browser binaries. A custom path is appropriate when a product requirement, enterprise image, or browser policy requires an installed build. The official API guidance warns to use executablePath with extreme caution because Playwright does not guarantee compatibility with arbitrary browser versions.

When a channel is better than a path

If the requirement is simply “run Chrome” or “run Edge” and the distribution is one of Playwright’s documented channels, try channel before hard-coding a machine-specific path:

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 #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
import { chromium } from 'playwright';

const browser = await chromium.launch({ channel: 'chrome' });
// or: { channel: 'msedge' }
await browser.close();

A channel expresses intent and is easier to share across machines than a path such as /home/runner/.cache/.... Use executablePath when you must identify a particular file.

Install and locate Playwright-managed browsers correctly

If your goal is to change where Playwright downloads its own browsers, do not point executablePath at a cache directory. Set PLAYWRIGHT_BROWSERS_PATH for both installation and execution, then install the binaries required by the Playwright version in use:

PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers npx playwright install

Setting PLAYWRIGHT_BROWSERS_PATH=0 opts into a hermetic install in Playwright’s local browser directory. This setting does not relocate a separately installed Google Chrome or Microsoft Edge.

In CI, configure the variable in the same job environment that runs the tests. Installing into one account’s home directory and executing as another account is a common cause of “browser not found” failures.

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

Validate a custom executable before launching

  1. Confirm the exact file. Check the path inside the machine, container, or runner where Playwright executes. A path valid on your laptop may not exist in CI.
  2. Check permissions. The process user needs permission to read and execute the file and traverse every parent directory.
  3. Check the browser family. Pass a Chromium executable to chromium, a Firefox executable to firefox, and a WebKit executable to webkit.
  4. Resolve relative paths deliberately. Print process.cwd() in Node.js or Path.cwd() in Python when diagnosing a path that works locally but fails in a runner.
  5. Verify version alignment. Install the Playwright package and browser build intended for the same project revision. A system browser that updates independently can break a previously working setup.

Troubleshoot launch failures

“Executable doesn’t exist” or a similar missing-file error

The string is wrong, the file is absent in the runtime environment, or a relative path is being resolved from an unexpected directory. Log the resolved value, switch to an absolute path, and verify the file from the same user and container that runs the test.

Permission denied

The executable bit or directory permissions prevent the Playwright process from starting the browser. Correct ownership and execute permissions, or install the browser in a directory readable by the service account. Do not fix this by running the entire test suite as an unrelated privileged user.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

The browser starts and immediately exits

Version incompatibility is a likely cause when a custom Chromium, Chrome, Firefox, or WebKit build is used. First reproduce with Playwright’s bundled browser. If the bundled build works, either use it, select a supported channel, or install a browser revision compatible with the project’s Playwright version.

Works locally, fails in CI or Docker

Compare the working directory, operating-system image, browser path, user account, and installed system dependencies. Ensure the custom executable is copied into the image and that the launch command does not rely on a developer-only path. For managed browsers, set PLAYWRIGHT_BROWSERS_PATH consistently during installation and test execution.

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

Need more launch detail

Enable Playwright’s browser debug logging:

DEBUG=pw:browser npx playwright test

On Windows PowerShell, set the variable for the command with the shell’s environment syntax:

$env:DEBUG = 'pw:browser'
npx playwright test

The logs help distinguish a bad path from a process crash, missing dependency, or incompatible executable.

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

Operational considerations

Reproducibility

Pin the Playwright package and avoid silently changing the system browser underneath a test suite. If a custom binary is mandatory, provision it as part of the image or build and record its version alongside the test dependencies.

Security

Treat the executable path as deployment configuration, not untrusted page input. Do not construct it directly from user-controlled strings. Keep browser binaries updated through the normal security process while checking compatibility after upgrades.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Performance

The path option itself does not make a browser faster; it only chooses which executable starts. Startup time and stability depend on the selected build, the machine, and whether the browser is already installed and cached. Measure those factors in the environment that matters rather than assuming a system browser is quicker.

Or skip the browser setup

If your goal is to obtain a reliable website screenshot rather than control a local browser binary, ScreenshotNeo provides a website screenshot API and MCP server. A single request returns PNG, JPEG, WebP, or PDF output, so there is no Playwright installation, browser path, or container dependency to maintain.

Use the API documentation for all parameters and response details: ScreenshotNeo API docs.

cURL

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

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)

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 accepts the cookie or consent banner 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 or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

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

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan, and annual billing provides two months free. Create a free ScreenshotNeo account to start with the 1,000 monthly shots.

Executable-path checklist

  • Use executablePath in JavaScript or TypeScript and executable_path in Python.
  • Put the option under use.launchOptions in Playwright Test.
  • Prefer an absolute path and verify it in the actual runtime environment.
  • Use PLAYWRIGHT_BROWSERS_PATH for managed-browser storage, not arbitrary executable selection.
  • Try a documented channel when you need Chrome or Edge without a machine-specific path.
  • Use the bundled browser unless a specific installed build is required, and enable DEBUG=pw:browser when a launch fails.

Frequently Asked Questions

Does executablePath download a browser for me?

No. It only tells Playwright which existing executable to launch. Install that browser separately, or use Playwright’s browser installation commands and PLAYWRIGHT_BROWSERS_PATH for managed binaries.

Should the path point to ChromeDriver or another WebDriver binary?

No. The option expects the browser executable itself, such as Chrome, Chromium, Firefox, or WebKit—not a driver process.

Why can the same path work in a terminal but fail in a test runner?

Relative paths use the launching process’s current working directory, and runners often start from a different directory or user account. Resolve and log an absolute path in the runner’s environment.

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.

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.