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 DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
browser automation

How to Fix Playwright Screenshots That Are Not Saved

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.

If a Playwright screenshot is missing, first check whether the call supplied path and whether you are looking in the process’s current working directory. Without path, Playwright returns image bytes in memory and writes no file.

Start with the three checks that solve most missing files

  1. Confirm a path is present. Use await page.screenshot({ path: 'artifacts/page.png' }). Calling await page.screenshot() captures an image buffer but does not create a disk file.
  2. Await the promise. The screenshot operation is asynchronous. If the test or script exits before await completes, no artifact may be available.
  3. Find the process working directory. A relative path such as artifacts/page.png is resolved from process.cwd(), not from the directory containing your test file.
console.log('working directory:', process.cwd());
await page.screenshot({ path: 'artifacts/page.png' });

For diagnosis, replace the relative path with an absolute path in a directory you know is writable. Once the capture appears there, you can choose a project-relative location deliberately.

Write a screenshot directly to disk

Basic page screenshot

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'artifacts/page.png' });
await browser.close();

The parent directory must already exist or be creatable by the process. The call resolves after Playwright has written the image. Add fullPage: true when the required artifact should include the entire scrollable page rather than only the current viewport:

await page.screenshot({
  path: 'artifacts/full-page.png',
  fullPage: true,
});

Screenshot a locator

The locator screenshot API follows the same save rule: include path for a file, or omit it when you intentionally want an in-memory buffer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Lexar D40E 128GB Dual USB 3.2 Gen 1 Type-C Jump Drive, Champagne Silver
  • USB-C 2-in-1 storage OTG: The Lexar JumpDrive Dual Drive D40E features USB Type-A and Type-C connectors in a slim, portable form factor for easy device compatibility
  • Transfer speeds up to 100MB/s: Based on internal testing, performance may vary depending upon the host device, interface, and usage conditions. 1MB=1,000,000 bytes
  • Plug and Play: Widely compatible with USB Type-C smartphones, tablets, laptops, Macs, and traditional Type-A devices, no software installation required. The 360° swivel design allows for easy switching between connectors without the hassle of losing a cap
  • Durable & Compact: The Lexar D40E USB memory stick features a metal enclosure, withstands temperatures from 0° to 50° C (32°F to 122°F), and is lightweight at 26g with dimensions of 70.4 x 16.9 x 11.7mm
  • Security & Warranty: Securely protects files using an advanced security software solution with 256-bit AES encryption. Backed by a Lexar 3-year limited warranty
const card = page.locator('[data-testid="pricing-card"]').first();
await card.screenshot({ path: 'artifacts/pricing-card.png' });

Use a known absolute path while debugging

import path from 'node:path';

const output = path.resolve(process.cwd(), 'artifacts', 'debug.png');
console.log('saving screenshot to:', output);
await page.screenshot({ path: output });

Logging the resolved value removes ambiguity caused by IDE launch directories, package scripts, monorepo workspaces, and CI runners.

Know which Playwright mechanism you are using

A missing image can be completely normal when the code uses a different destination model. Match the mechanism to the artifact you expect.

Mechanism Intended destination Who owns the path What to inspect
page.screenshot({ path }) or locator.screenshot({ path }) An ordinary image file Your code The supplied path and process.cwd()
page.screenshot() without path In-memory image data Your code or a downstream consumer Whether you write, attach, or process the returned buffer
expect(page).toHaveScreenshot() A visual snapshot baseline and comparison Playwright Test’s snapshot configuration The test’s snapshots directory and named snapshot rules
testInfo.outputPath('name.png') A test-run output artifact Playwright Test for the run-specific root The returned output path and reporter retention
testInfo.attach() A reporter-accessible attachment The test runner and reporter Attachment name, body or path, content type, and reporter settings
Automatic screenshots in Playwright Test Runner-managed artifacts Playwright Test configuration The configured screenshot mode and failure status

When the code intentionally returns a buffer

Playwright can return image bytes instead of writing a file. This is useful for image processing, pixel comparison, or test reports. A buffer is not a failed screenshot; it is the requested result.

const screenshot = await page.screenshot();
console.log('bytes:', screenshot.length);

To make that buffer visible to Playwright Test reporters, attach it with a content type:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const screenshot = await page.screenshot();
await testInfo.attach('page-screenshot', {
  body: screenshot,
  contentType: 'image/png',
});

This pattern does not create the same ordinary file as page.screenshot({ path }). The reporter decides where and how an attachment is displayed or retained.

Playwright Test snapshots are not ordinary screenshot files

expect(page).toHaveScreenshot() is a visual assertion. It creates or checks a baseline snapshot using the test runner’s snapshot configuration. A named snapshot path must remain inside that test’s snapshots directory; it is not an arbitrary replacement for the path in page.screenshot({ path }).

Rank #2
SANDISK 128GB Ultra Flair, USB-A Flash Drive, Up to 150MB/s Read Speeds
  • High-speed USB 3.0 performance of up to 150MB/s(1) [(1) Write to drive up to 15x faster than standard USB 2.0 drives (4MB/s); varies by drive capacity. Up to 150MB/s read speed. USB 3.0 port required. Based on internal testing; performance may be lower depending on host device, usage conditions, and other factors; 1MB=1,000,000 bytes]
  • Transfer a full-length movie in less than 30 seconds(2) [(2) Based on 1.2GB MPEG-4 video transfer with USB 3.0 host device. Results may vary based on host device, file attributes and other factors]
  • Transfer to drive up to 15 times faster than standard USB 2.0 drives(1)
  • Sleek, durable metal casing
  • Easy-to-use password protection for your private files(3) [(3)Password protection uses 128-bit AES encryption and is supported by Windows 7, Windows 8, Windows 10, and Mac OS X v10.9 plus; Software download required for Mac, visit the SanDisk SecureAccess support page]

If your goal is a normal artifact for debugging, use an explicit page screenshot or a test output path. If your goal is visual regression, keep the assertion and inspect the configured snapshot location instead of searching the current working directory.

Put a debug image in the test output directory

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

test('checkout page', async ({ page }, testInfo) => {
  await page.goto('https://example.com/checkout');
  const output = testInfo.outputPath('checkout-debug.png');
  await page.screenshot({ path: output, fullPage: true });
  console.log('test artifact:', output);
});

testInfo.outputPath() gives the run-specific output location managed by Playwright Test. Use it when artifacts should follow the test runner’s retention and reporter conventions.

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

Configure automatic screenshots deliberately

Playwright Test’s documented screenshot setting defaults to off. Supported modes include on, only-on-failure, and on-first-failure. If you expect screenshots without an explicit call, configure a mode in the test configuration.

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

export default defineConfig({
  use: {
    screenshot: 'only-on-failure',
  },
});
  • on captures for every test according to the runner’s artifact handling.
  • only-on-failure limits captures to failed tests.
  • on-first-failure captures the first failure in a retry sequence.
  • off requires your test code to request screenshots explicitly.

When automatic capture is enabled but the file is still absent, inspect the test result’s output and reporter rather than the directory from which you launched the command.

Troubleshoot by symptom

“The call succeeds, but there is no PNG”

  • Look for path. If it is absent, consume the returned buffer or add a path.
  • Check for a missing await.
  • Print process.cwd() and resolve the complete path.
  • Verify that the destination directory exists and that the process can write there.

“The file exists, but not where I expected”

Relative paths follow the process working directory. IDEs, npm scripts, workspace tools, and CI jobs can select different working directories. Log both process.cwd() and the absolute path passed to Playwright.

“My visual snapshot is missing”

Check that you are looking in the test’s snapshots directory and that the snapshot name remains inside the permitted snapshot path. toHaveScreenshot() is managed by Playwright Test and does not use an arbitrary output directory in the same way as a direct screenshot call.

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.
Rank #3
2 Pack 64GB USB Flash Drive USB 2.0 Thumb Drives Jump Drive Fold Storage Memory Stick Swivel Design - Black
  • What You Get - 2 pack 64GB genuine USB 2.0 flash drives, 12-month warranty and lifetime friendly customer service
  • Great for All Ages and Purposes – the thumb drives are suitable for storing digital data for school, business or daily usage. Apply to data storage of music, photos, movies and other files
  • Easy to Use - Plug and play USB memory stick, no need to install any software. Support Windows 7 / 8 / 10 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, compatible with USB 2.0 and 1.1 ports
  • Convenient Design - 360°metal swivel cap with matt surface and ring designed zip drive can protect USB connector, avoid to leave your fingerprint and easily attach to your key chain to avoid from losing and for easy carrying
  • Brand Yourself - Brand the flash drive with your company's name and provide company's overview, policies, etc. to the newly joined employees or your customers

“The screenshot is not in the test report”

A disk file alone may not be linked to a reporter. Use testInfo.attach() with either a buffer or a file path, set the correct content type, and confirm that the selected reporter retains attachments.

“Failure screenshots never appear”

Inspect the effective Playwright Test configuration. Automatic screenshots are disabled when the mode is off. Set screenshot: 'only-on-failure' or another supported mode, then check the runner-managed output.

“The browser closes before the artifact is usable”

Keep the screenshot call awaited and complete before closing the page or browser. In standalone scripts, also keep the process alive until the promise resolves; in tests, let the test function return only after capture and attachment finish.

“The path works locally but fails in CI”

Print the resolved path in CI, create the destination directory as part of setup, and inspect the runner’s artifact-upload configuration. The documented Playwright APIs do not identify one universal container or permission cause; the runtime error and CI setup determine the fix.

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

Choose the right artifact workflow

Ordinary file for a script or local debugging

Use page.screenshot({ path }) with an absolute path while diagnosing, then switch to a deliberate relative path if desired.

Visual regression baseline

Use expect(page).toHaveScreenshot() and keep baseline names and locations under the test runner’s snapshot configuration.

Rank #4
SIMMAX 32GB Memory Stick USB 2.0 Flash Drives Swivel Thumb Drive Pen Drive (32GB Purple)
  • GOOD VALUE PACKAGE - 1 Pack 32GB Memory Stick USB 2.0 Flash Drives with great cost performance and high quality.
  • BIG CAPACITY - The available capacity: 29.10GB-29.8GB, You can save the data of movies, music, photos, designs, programs, manuals, handouts in a high speed.Good performance in digital data storing, transferring and sharing with families, friends, workmates, clients and machines.
  • EASY TO USE & PLUG AND WORK - Support windows 7 / 8 / 10 / Vista / XP / 2000 / ME / NT Linux and Mac OS, Compatible with USB2.0 and below.
  • TWISTTURN DESIGN & EASY CARRY - The metal clip rotates 360° round the ABS plastic body which with rubber oil skin feeling finish. The capless design can avoid lossing of cap, and providing efficient protection to the USB port.
  • WARRANTY & SUPPORT - SIMMAX logo is laser printed on the USB connector surface, our products are of good quality and we promise that any problem about the product within one year since you buy.

CI artifact attached to a test

Use testInfo.outputPath() for a run-specific file, or capture a buffer and pass it to testInfo.attach() so reporters can expose it.

Automatic failure evidence

Set the screenshot mode in configuration and verify the reporter’s output directory and retention rules.

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

Performance, reliability, and version boundaries

Full-page captures can require more page layout and image data than viewport captures, especially on pages with lazy-loaded content. Choose fullPage: true only when the complete scrollable document is needed. For repeatable tests, wait for the page state your assertion requires before capturing; a screenshot can be written successfully while still showing an intermediate UI state.

The official Playwright documentation and API references used for these behaviors were accessed on September 29, 2026, and are rolling pages. Screenshot options can have version-added annotations. Check the Playwright package version installed in your project and consult the matching API reference before relying on an option that may not exist in that version.

No general performance benchmark or failure-rate statistic establishes how quickly a screenshot should be written. Measure your own script or test runner if capture time matters, and preserve the exact resolved path and mechanism in CI logs so a missing artifact can be diagnosed after the run ends.

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

Or skip the browser setup

If you only need a screenshot of a public URL, ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF. Before capture, it accepts cookie or consent banners like a visitor and removes 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 the response identifies the result with X-Page-Verdict and X-Billed headers.

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

Use the API documentation at https://screenshotneo.com/docs/ for request details. The following calls are runnable once YOUR_API_KEY is replaced.

Best Value
Sale
IMEASON Swivel Design 16GB USB Flash Drive with Keychain, USB 2.0 Portable Thumb Drive Memory Stick, FAT32 Format Flashdrive for Data Storage, Photos, Music, Files (Black, 16 GB)
  • 【16GB Flash Drive】USB flash drives with 16GB capacity, meet your needs of daily use on work, school, home and travelling for photos, music, videos, files storage and transfer. IMEASON thumb drives can be used to store different files, easy to data backup.
  • 【Metal Swivel Cap Design】USB thumb drive is metal swivel cover provides extra protection for the usb thumbdrive connector, no usb drive cap to lose; keychain design makes it easier to carry without worrying lose it.
  • 【Wide Compatibility】USB drive supports Windows 7/8/10/11 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, also Supports USB 2.0 and 1.1 ports. USB Stick support TV, desktop, notebook computer, car, audio and other device. The USB Memory Stick is your great data storage and transfer companion with traveling and working.
  • 【Easy to use】usb memory stick is plug and play without any software installation. Just simply plug the Flashdrive into the port of your USB-compatible devices such as computer, laptop to start data storage or transmission.
  • 【What You Get】16 GB USB Flash Drive Thumb Drive, The default format of the usb storage flash drive is FAT32.

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

Options for production captures

ScreenshotNeo exposes 63 options, including full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets plus custom viewports, retina scale, PDF paper size/margins/landscape/page ranges, HTML or CSS to image, custom JavaScript and CSS, pre-capture clicks, hidden selectors, waits for a selector or delay or network idle, blocking ads, trackers, requests, or resource types, custom headers/cookies/user agents/Authorization, timezone and geolocation, transparent backgrounds, image resizing, cache TTLs, signed links for public <img> tags, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work to ease migration.

MCP for AI agents

The MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. That lets an AI agent request a capture without you wiring a browser in the agent process.

Plans and billing

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

Every feature is available on every plan, and yearly billing gives two months free. Start with 1,000 free screenshots a month with no card, then choose a paid plan starting at $5 for 3,000 shots if your volume requires it.

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

Frequently Asked Questions

What details should I record before asking for help with a missing screenshot?

Record the installed Playwright version, exact screenshot mechanism, complete resolved path, current working directory, operating environment, and the full runtime error or test-report location. Those details distinguish a buffer, a framework-managed snapshot, and a write or retention problem.

How can I tell whether a reporter hid an artifact rather than Playwright failing to capture it?

Print the path returned by testInfo.outputPath(), inspect the runner’s output directory after the test, and compare that file with the reporter’s attachment list. A present file with no report link points to reporter configuration or retention, not capture.

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.

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.