Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk7 min

Fix Blank Screenshots in Playwright with Headless Chromium

A blank Playwright screenshot can begin with navigation, page readiness, rendering, or capture mode. Use these checks to isolate the failing layer in headless Chromium.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A blank Playwright screenshot does not by itself tell you whether Chromium failed to render, the page failed to load, or the capture happened before meaningful content appeared. First verify navigation and the page’s actual state, then inspect browser and network errors, compare capture modes, and check that headed and headless runs use the same browser and environment.

1. Verify navigation and the page state

Record the outcome of page.goto(), the final URL, and whether the page reached the site you expected. A failed navigation or an error page can explain a blank image before screenshot capture is involved. One Playwright issue reports a blank capture after navigation to an unreachable site; it is an individual report, not proof that all navigation errors produce blank screenshots (Playwright issue #23632).

As an Amazon Associate I earn from qualifying purchases.

Next, wait for an assertion tied to the content that matters: a heading, result, image, or other page element. A navigation event alone does not prove the application has finished rendering its useful state. Likewise, a visible locator is helpful evidence, but a report describes a blank toHaveScreenshot() result even after a locator was visible (Playwright issue #21657).

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

Example: assert on expected content before capturing

This JavaScript example uses Playwright Test. Replace the URL and locator with the page and content your test actually needs. It logs navigation and browser diagnostics, then saves a viewport screenshot only after the expected heading is visible.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
import { test, expect } from '@playwright/test';

test('capture the rendered page', async ({ page }) => {
  page.on('console', message => {
    if (message.type() === 'error') console.error('Console error:', message.text());
  });
  page.on('pageerror', error => console.error('Page error:', error.message));
  page.on('requestfailed', request => {
    console.error('Request failed:', request.url(), request.failure()?.errorText);
  });
  page.on('response', response => {
    if (response.status() >= 400) {
      console.error('HTTP response:', response.status(), response.url());
    }
  });

  const response = await page.goto('https://example.com', {
    waitUntil: 'domcontentloaded',
    timeout: 30_000,
  });
  console.log('Navigation status:', response?.status() ?? 'no HTTP response');
  console.log('Final URL:', page.url());

  await expect(page.getByRole('heading', { name: 'Example Domain' })).toBeVisible();
  await page.screenshot({ path: 'page.png' });
});

Use a locator that represents the content whose presence makes the screenshot useful. If it times out, investigate the app’s loading state and errors rather than replacing the assertion with a fixed sleep and assuming the page is ready.

2. Choose a readiness condition that means something

Playwright supports navigation waits including commit, domcontentloaded, load, and networkidle. These describe navigation or network conditions; none inherently verifies that your application has displayed the intended content. Playwright defines networkidle as no network connections for at least 500 ms and discourages using it as a test readiness condition (Playwright API parameters).

  • Use a web-first assertion for the heading, result, or other content that must appear in the image.
  • If the assertion passes but the capture is blank, check whether the page still shows a loading shell, content is hidden or covered, or application data has not arrived.
  • Use a timeout to fail clearly when the expected state never appears; do not interpret a longer wait as proof of successful rendering.

3. Read the browser and network diagnostics

Log console errors, uncaught page errors, failed requests, HTTP response statuses, and the final URL. Compare them with the page’s document state and expected-content locator. This helps separate a genuinely empty or error page from a problem in the screenshot capture or file-saving path. A browser console or failed request is a diagnostic lead, not automatically the cause; connect it to the missing content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Check the output file too: confirm the screenshot call completed, the path is the one you later inspect, and the file is not being overwritten by another test. Playwright can save a screenshot to a path or return image bytes; its documentation describes viewport, full-page, element, and buffer capture options (Playwright Screenshots).

4. Compare viewport, element, and full-page captures

Capture the visible viewport, a relevant locator, and the full page separately. If only full-page output is blank or abnormal, try a smaller page region or element to determine whether the symptom is tied to full-page capture. If all modes are blank, return to navigation, readiness, and rendering diagnostics. These comparisons narrow the problem; they are not guaranteed fixes.

await page.screenshot({ path: 'viewport.png' });
await page.screenshot({ path: 'full-page.png', fullPage: true });
await page.getByRole('main').screenshot({ path: 'main-element.png' });

For visual-test screenshots, the same principle applies: compare the capture mode and the page state that the test actually needs. See Playwright’s screenshot documentation for the supported approaches.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

5. Match headed and headless environments

When the page works in headed mode but not headless, compare the two runs while holding other variables constant. Playwright warns that rendered output can vary with host operating system, browser version, settings, hardware, power source, and headless mode; it recommends creating visual baselines in the same environment used for comparison (Playwright visual comparisons).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Playwright release and its bundled Chromium build
  • Operating system or container image
  • Browser executable and launch arguments
  • Viewport size and device scale factor
  • Navigation result, final URL, and content-specific assertion
  • Console errors, failed requests, and response statuses
  • Screenshot mode: viewport, locator, or full page
  • Font and image loading state

Prefer Playwright’s bundled Chromium unless you intentionally need a different executable. A comparison between headed and headless is most useful when the browser build, app state, viewport, and other settings match.

6. Investigate fonts and images when the evidence points there

Screenshot preparation may wait for fonts, and failed font requests can affect timing or appearance. Playwright issue reports include a screenshot timeout while waiting for fonts and a separate report about flaky font differences in full-page visual comparisons (Playwright issue #35972). These reports make font loading worth checking when logs mention fonts, requests fail, or typography changes; they do not establish fonts as the cause of every blank screenshot.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Inspect failed font and image requests and verify that the expected resources load in the same environment as the test. If typography or image layout differs, wait for the relevant resource or application state through a specific assertion where possible, then recapture.

7. Reduce the problem to a minimal reproduction

  1. Keep the same URL, or substitute a small local page that reproduces the symptom.
  2. Record the Playwright version, bundled browser, OS or container, and launch options.
  3. Use one navigation call and one assertion for the content expected in the capture.
  4. Capture viewport, locator, and full-page images separately.
  5. Remove custom fixtures, helpers, and launch changes one at a time.
  6. Report whether the page itself is blank before capture and whether the problem reproduces in a matching environment.

Blank-capture reports describe different circumstances, including a visible locator and a failed navigation, so a reliable fix depends on reproducing the specific failure rather than assuming one universal Chromium defect (issue #21657; issue #23632).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common symptoms and next steps

Symptom What to check next
Navigation times out or ends at an unexpected URL Inspect the page.goto() result, final URL, response status, and failed requests before debugging screenshot output.
The expected locator never becomes visible Check application loading state, console and page errors, and whether the expected data request succeeded.
A locator is visible but the image is blank Check whether the page content is covered or otherwise not painted as expected; compare viewport, locator, and full-page captures.
Viewport works but full-page capture does not Try a smaller element or region and investigate whether the behavior is specific to full-page capture.
Capture waits or layout differs around typography Inspect font requests and screenshot logs; treat fonts as a likely lead only when the symptoms point to them.
Headed and headless images differ Match browser build, OS/container, settings, viewport, and app state before drawing conclusions about headless mode.

Or skip the browser setup

If you need screenshots without maintaining a Playwright browser setup, ScreenshotNeo is a website screenshot API and MCP server. Its one-call API can return an image or PDF, and the equivalent cURL request is:

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo accepts cookie and 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/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up free for 1,000 screenshots a month—no card required.

Frequently Asked Questions

Does waiting for a visible element guarantee the screenshot will not be blank?

No. It confirms that the locator passed its visibility condition, but a reported Playwright case still produced a blank screenshot. Check page state and compare capture modes.

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

Should I use networkidle before taking a screenshot?

Not as a general readiness guarantee. Playwright defines it as 500 ms without network connections and discourages it for tests; assert on the content your screenshot needs.

Is headless Chromium itself the cause?

The symptom alone does not establish that. Verify navigation and rendering first, then compare browser and runtime environments.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.