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

From your WSL2 project directory, run npx playwright test --debug. Playwright starts the Inspector and a headed browser. The windows appear on the Windows desktop only when WSLg is working and your system meets Microsoft’s WSL GUI requirements.

Run the Inspector from a WSL2 Playwright project

Open your WSL distribution, change to the directory containing your Playwright Test project, and use the project’s local Playwright installation:

npx playwright test --debug

This debug shortcut enables an interactive session: tests run headed, one worker is used, the timeout is disabled, and execution stops after the first failure. The Inspector window and browser should be displayed through WSLg on your Windows desktop.

Debug one test file

Limit the run to a file when a whole suite would be too large to inspect:

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.
npx playwright test tests/example.spec.ts --debug

You can target a particular test line by appending :line to the file path, as documented by Playwright:

npx playwright test tests/example.spec.ts:42 --debug

Use the environment-variable form

The equivalent workflow sets PWDEBUG=1 and then runs the test command:

PWDEBUG=1 npx playwright test

In practice, --debug is easier to remember and applies the same interactive defaults. Playwright also supports PWDEBUG=console for its documented browser developer-tools workflow.

Prepare Playwright inside WSL2

Install the project dependencies

Run the commands from the Linux filesystem or from the project directory mounted in WSL. Use the package manager and Playwright version already declared by the project rather than a separate global installation.

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

Download the browser binaries

If the project has not downloaded its browsers, install them from WSL:

npx playwright install

To install only Chromium:

npx playwright install chromium

Install Linux browser dependencies when required

A browser can be present while required Linux libraries are missing. Playwright’s installer can add those dependencies:

npx playwright install --with-deps

You can combine the dependency option with a selected browser when appropriate for your project. Run these commands inside WSL, not in Windows PowerShell, so the binaries and libraries are installed in the environment that launches the test.

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.

Verify that WSLg can show the Inspector

Playwright’s Inspector is a Linux GUI application. WSLg is Microsoft’s path for displaying Linux GUI applications on the Windows desktop; it is not a separate, full Linux desktop environment.

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

Confirm the distribution uses WSL2

Microsoft states that Linux GUI apps are supported only with WSL2, not with a distribution configured for WSL1. From an elevated Windows PowerShell or Command Prompt, inspect your distributions:

wsl -l -v

The distribution that contains the project should show version 2. If it shows version 1, convert or recreate the distribution as WSL2 before expecting a GUI window.

Check the Windows version

Microsoft documents WSL GUI support for Windows 11 and for Windows 10 build 19044 or later. On Windows 10, verify the build in Settings → System → About or with winver. An older build does not meet the documented prerequisite.

Check the graphics driver

WSLg uses virtual GPU support. Microsoft’s prerequisites include a graphics driver compatible with the machine’s GPU. Install or update that driver through the hardware vendor’s supported Windows package before troubleshooting Playwright itself.

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

Update and restart WSLg

If GUI applications previously worked but the Inspector no longer appears, update WSL and restart its virtual machine from an elevated Windows shell:

wsl --update
wsl --shutdown

Start the distribution again, return to the project, and retry npx playwright test --debug. The shutdown ends all running WSL distributions, so save work in other WSL terminals first.

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.

Work through a test in Inspector

When the Inspector opens, start the test and use its controls to move through actions one at a time. The workflow is useful when you need to see why a locator, navigation, assertion, or interaction behaves differently than expected.

Step over actions

Use the step controls to advance through the test. Observe the headed browser after each action and check the Inspector’s actionability information when an element is not ready, visible, enabled, or otherwise actionable.

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

Pick and refine locators

The locator picker lets you select an element in the browser and edit the generated locator live. Refine the locator until it identifies the intended element rather than a coincidental match.

Pause at a deliberate point

For a pause at a known point in the test, add page.pause() in the test code:

import { test, expect } from '@playwright/test';

test('inspect checkout', async ({ page }) => {
  await page.goto('https://example.com/checkout');
  await page.pause();
  await expect(page.getByRole('heading', { name: 'Checkout' })).toBeVisible();
});

Run the test with debug settings so the pause opens the Inspector in a headed session.

Inspector or UI Mode?

Both are Playwright workflows, but they solve different problems.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Need Use What it provides
Pause a running test, step through actions, inspect actionability, or refine a locator in context npx playwright test --debug (Inspector) Controlled execution with a headed browser and focused pauses
Browse tests visually, pick locators, use watch mode, and inspect traces before, during, and after runs npx playwright test --ui (UI Mode) A broader interactive test-running experience

UI Mode is not a replacement for a precise pause inside one test. Conversely, Inspector is not intended to provide UI Mode’s broader browsing and trace-oriented workflow. Both still need a working WSLg display when launched from WSL.

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

Troubleshoot when no window appears

“Cannot open display” or no GUI window

  • Confirm the distribution is WSL2, not WSL1.
  • Confirm Windows 10 is build 19044 or later, or use Windows 11.
  • Install the GPU driver required for virtual GPU support.
  • Run wsl --update, then wsl --shutdown, and start WSL again.
  • Test another simple Linux GUI application. If it also fails, the issue is WSLg or the Windows graphics configuration rather than the Playwright test.

Microsoft maintains a WSLg “cannot open display” troubleshooting path for machine-specific display failures. WSL GUI support depends on the Windows desktop and does not provide a complete Linux desktop session.

“Executable doesn’t exist” or browser launch failure

The Playwright package may be installed while its browser binary is not. Run npx playwright install, or install the selected browser explicitly, such as npx playwright install chromium.

Missing shared libraries or dependency errors

Install the Linux dependencies with npx playwright install --with-deps. Repeat the command inside the same WSL distribution that runs the tests.

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

The test exits too quickly

Make sure the debug flag is attached to the Playwright Test command, not to a wrapper that never forwards it:

npx playwright test tests/example.spec.ts --debug

If you need a pause at a specific location, add await page.pause() and rerun in debug mode.

The wrong tests run

Pass the test file or line selector explicitly. This reduces noise and makes the Inspector session easier to follow:

npx playwright test tests/login.spec.ts:18 --debug

Debugging is affected by parallel workers

Debug mode uses one worker by default. If a custom configuration overrides workers, restore a single worker for an orderly interactive session:

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.
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.
npx playwright test --debug --workers=1
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Reliability and performance considerations

Expect interactive runs to be slower

Debug mode deliberately disables the normal timeout, runs headed, and processes tests one at a time. That is useful for observation but not a performance benchmark. Use a normal headless run for timing and CI validation after the issue is understood.

Keep browser and project versions aligned

Install browsers with the Playwright CLI associated with the project. Mixing a global CLI, a different package version, and stale browser binaries can produce launch or protocol failures that do not occur in a clean project installation.

Separate display failures from test failures

If the command reports a test assertion error, the Inspector and browser launched successfully; investigate the test. If the command fails before a window appears, check WSL2, WSLg, Windows build, driver, browser binaries, and Linux dependencies in that order.

Or skip the browser setup

If your goal is to capture a page rather than step through a Playwright test, ScreenshotNeo provides a website screenshot API and MCP server. It removes cookie-consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its response identifies the page verdict and billing status in X-Page-Verdict and X-Billed headers. An 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.

Use one GET request (see the ScreenshotNeo API documentation):

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,
)
r.raise_for_status()
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}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const buffer = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', buffer));

ScreenshotNeo includes full-page capture, lazy-image loading, CSS-selector element capture, device presets, custom viewports, retina scale, PDF output, custom CSS and JavaScript, click and wait actions, request blocking, headers and cookies, timezone and geolocation, transparent backgrounds, resizing, configurable caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Its parameter names are compatible with those used by other screenshot APIs, which can simplify migration.

Plan Allowance Price
Free 1,000 shots per month $0, no card
Starter 3,000 shots $5
Growth 15,000 shots $15
Pro 60,000 shots $39
Scale 250,000 shots $99
Business 1,000,000 shots $249

Yearly billing gives two months free, and every feature is included on every plan. Sign up for ScreenshotNeo to get 1,000 screenshots each month without a card.

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.

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