October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Playwright Screenshot Timeout: Causes and Fixes

A Playwright screenshot timeout may come from the capture call, a visual assertion, an earlier action, or the test runner. Here’s how to tell and fix each one.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Playwright screenshot timeout is not always a timeout in page.screenshot(). First identify the failing operation: the screenshot API, a toHaveScreenshot() assertion, an earlier action or navigation, or the test’s overall time limit. Each has a separate budget, so increasing the wrong one will not fix the failure.

Identify which operation timed out

Start with the complete error, stack trace, and Playwright call log. Find the last operation that failed and distinguish it from the operation that happened to run just before it.

  • page.screenshot() captures image bytes using the Page API’s screenshot timeout option.
  • expect(page).toHaveScreenshot() is a visual assertion with its own expect timeout.
  • A locator action or navigation immediately before capture may be governed by an action or navigation timeout.
  • The test runner can end the entire test when its test timeout expires, even if the screenshot API itself has no timeout.

These limits are independent. A screenshot option cannot extend the test budget, and increasing the test budget does not automatically change an expect assertion’s timeout.

Understand the separate timeout budgets

Budget What it governs Documented default or setting
Screenshot API The page.screenshot() operation. The Page API documents timeout as 0 by default, meaning no screenshot-specific timeout. The documented default can be changed using actionTimeout or page.setDefaultTimeout()/browserContext.setDefaultTimeout(). Playwright Page API.
Test The test function, fixture setup, and beforeEach hooks share this budget. 30,000 ms is Playwright’s documented default, not a benchmark. Playwright Test timeouts.
Expect Async assertions, including toHaveScreenshot(). 5,000 ms is Playwright’s documented default, separate from the test timeout. Playwright Test assertions.
Action and navigation Locator actions and navigation operations have their own configurable limits. Configure actionTimeout and navigationTimeout where appropriate; neither is the overall test timeout. Playwright Test timeouts.

Playwright’s documentation is living documentation; verify the defaults and configuration against the installed version in your project. The figures above are documentation defaults, not study results.

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

Fix the timeout that actually applies

If page.screenshot() is the failing call

Set a screenshot timeout only if the capture itself legitimately needs a limit. For example, this gives the screenshot operation a 10-second limit:

await page.screenshot({ path: 'screenshot.png', timeout: 10_000 });

The API’s documented default is no timeout. Setting a finite limit is useful when you want a stalled capture to fail within a known interval; it does not grant extra time to the enclosing test. If the test ends first, increase the relevant test budget instead.

Rank #2
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
  • 1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core
  • 4GB DDR4 System Memory; 128GB Solid State Drive
  • 11.6" HD (1366 x 768) Multi-Touch Display
  • Combo headphone/microphone jack - Noble Wedge Lock slot - HDMI; 2 USB 3.1 Gen 1
  • Windows 11 Pro

If the overall test timed out

Navigation, setup, earlier actions, screenshot work, and fixture setup may all consume the same test allowance. Fixture setup and teardown count toward the test timeout by default, and a slow fixture can be the reason the test fails. Adjust the test timeout only when the complete test genuinely needs more time:

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

test('captures the report', async ({ page }) => {
  await page.goto('/report');
  await page.screenshot({ path: 'report.png' });
}, { timeout: 60_000 });

For a consistently slow fixture, consider a fixture-specific timeout rather than extending every test. Use the syntax supported by the Playwright version installed in your project and consult the timeout guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.

If toHaveScreenshot() is the failing call

This is an assertion timeout, not necessarily a failure to produce screenshot bytes. Give the assertion more time only if the visual comparison reasonably needs it:

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

test('report matches its reference', async ({ page }) => {
  await page.goto('/report');
  await expect(page).toHaveScreenshot({ timeout: 10_000 });
});

Keep the distinction clear: raising the expect timeout allows the assertion more time to reach a match; it does not repair a page that never becomes ready or make a wrong reference correct. Updating a stored reference is a separate task; Playwright documents --update-snapshots for that purpose. Visual comparisons and snapshots.

Rank #4
15.6 Inch Laptop Computer, N4020, 4GB DDR4 RAM, 128GB eMMC,with Windows 11
  • EFFORTLESS EVERYDAY PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 Home system, delivering reliable, low-power efficiency for daily tasks like document editing, email, online classes, and web browsing
  • 15.6-INCH FULL HD DISPLAY: Enjoy immersive visuals on the 15.6" FHD (1920x1080) anti-glare screen with micro-edge bezels. Delivers clear details and comfortable viewing for long study sessions, working on spreadsheets, and video playback
  • RESPONSIVE MULTITASKING & STORAGE: Built with 4GB LPDDR4 RAM and 128GB eMMC storage for smooth daily essential use. Expand your storage by up to 1TB via the integrated TF card slot to easily store movies, photos, and working files
  • ADVANCED CONNECTIVITY: Outfitted with 2x Full-Featured Type-C ports for data transfer, fast charging, and dual-monitor output, alongside 2x USB 3.2 Gen1 ports and a 3.5mm audio jack for complete peripheral compatibility
  • LIGHTWEIGHT & SILENT OPERATION: Slim and portable for effortless travel or commuting. Features a 1MP HD webcam for remote meetings, 38Wh battery with 45W Type-C fast charging, and a fanless silent design for peaceful work environments.

If an action or navigation is slow

Inspect the immediately preceding awaited operation. A click, locator action, or navigation may be waiting or timing out under its own setting. Configure the relevant action or navigation timeout rather than treating every delay as screenshot rendering. Playwright Test timeouts.

Wait for the page state the image needs

A screenshot can complete successfully and still show an incomplete page. Wait for a stable application signal—such as the target component becoming visible or a loading indicator disappearing—instead of adding an arbitrary delay.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
15.6 Inch Win 11 Laptop Computer, N4020, 4GB DDR4 RAM, 128GB Storage
  • WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
  • 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
  • 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
  • CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
  • LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.
await page.goto('/dashboard');
await page.getByRole('heading', { name: 'Dashboard' }).waitFor({ state: 'visible' });
await page.screenshot({ path: 'dashboard.png' });

Choose a locator or application-specific event that corresponds to the content the screenshot must contain. Playwright notes: “Most of the time, this method is not needed because Playwright auto-waits before every action.” Page API: waitForTimeout. Its guidance discourages timer-based waits in production tests because they are inherently flaky; a fixed sleep can make a test slower without making the page ready.

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

Common causes and what to check

  • The wrong timeout was increased: Compare the error to the exact call. Screenshot, test, expect, action, and navigation budgets are separate.
  • Earlier work used up the test budget: Include navigation, hooks, and fixtures in the timeline; fixture setup and teardown count by default.
  • A visual assertion is still retrying: Check whether toHaveScreenshot() is waiting for a stable visual match, rather than assuming page.screenshot() failed.
  • The preceding action or navigation is slow: Check its own timeout and call-log entry before changing screenshot settings.
  • The readiness condition is wrong or absent: Wait for the content or state that matters, not a generic number of milliseconds.
  • The snapshot itself differs: Diagnose the visual mismatch separately. Updating references with --update-snapshots is not a general timeout fix.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. For a straightforward URL capture, one GET request returns an image or PDF. The following cURL example saves a WebP screenshot; replace the sample URL with the page you need and provide your API key:

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

See the ScreenshotNeo documentation for API options. ScreenshotNeo accepts cookie or consent banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses report the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The Free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

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

Quick Recap

Bestseller No. 1
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$247.99
Bestseller No. 2
Dell Latitude 3190 11.6' HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core; 4GB DDR4 System Memory; 128GB Solid State Drive
Bestseller No. 3
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$299.99

Verify the fix

  1. Rerun the test with the same browser, environment, and installed Playwright version.
  2. Confirm the failing operation now completes within its intended budget.
  3. Inspect the resulting image to make sure the relevant content is ready and useful, not merely captured before a timeout.

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 *

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.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
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.