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.
#1 Best Overall
- 14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
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
- 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.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Rank #3
- 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
- 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.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchBest Value
- 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.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 assumingpage.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-snapshotsis 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.
Recommended Free Tools
Quick Recap
Verify the fix
- Rerun the test with the same browser, environment, and installed Playwright version.
- Confirm the failing operation now completes within its intended budget.
- 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.




