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 DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk6 min

Playwright Screenshot Is Blank After Clicking a Link: Fix Navigation Waits

A Playwright click can finish before the content you want to capture is ready. Match the wait to the behavior: use waitForURL for document navigation and a web-first assertion for SPA or in-page updates.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a Playwright screenshot is blank after a link click, wait for the result you actually need—not just for the click to finish. For a full-page navigation, wait for the destination URL and then assert that a meaningful destination element is visible. For a client-side route or in-page update, assert the new content directly before calling page.screenshot().

Why the click can finish before the screenshot is ready

locator.click() waits for the target to be actionable and, when the click triggers navigation, for navigation to happen and the page to start loading. That does not guarantee that the specific content you want to capture has rendered. Playwright is designed to act as soon as elements become actionable; navigation, loading, and readiness for the next interaction are distinct conditions. See the Playwright Page API and navigation guide.

As an Amazon Associate I earn from qualifying purchases.

A blank capture can therefore mean the screenshot was taken before the destination content appeared, but the symptom alone does not establish the cause. The click might also leave the URL unchanged, reveal content in place, open a new page, or appear to do nothing because the application is not hydrated yet. First identify which behavior the link is meant to trigger.

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

Wait for a full document navigation

When the link should navigate to a known URL, wait for that URL and then verify a destination-specific element. The assertion is important: the URL changing does not, by itself, prove that the content you need is visible.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • 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('captures the annual report', async ({ page }) => {
  await page.goto('https://example.com/reports');

  await page.getByRole('link', { name: 'Open report' }).click();
  await page.waitForURL('**/reports/annual');
  await expect(
    page.getByRole('heading', { name: 'Annual report' })
  ).toBeVisible();
  await page.screenshot({ path: 'report.png' });
});

Replace the example host, link name, URL pattern, heading, and output path with values from your app. Use a locator that represents content the screenshot is supposed to show, rather than a generic element that could appear on an error or loading page. Playwright documents page.waitForURL() for waiting for the main-frame URL and locator assertions such as toBeVisible() retry while checking their condition: Page API and test assertions.

Register the URL wait before clicking when needed

If the navigation can happen before a subsequent wait is set up, or you want the wait registered before the action, start both together with Promise.all():

await Promise.all([
  page.waitForURL('**/reports/annual'),
  page.getByRole('link', { name: 'Open report' }).click(),
]);
await expect(
  page.getByRole('heading', { name: 'Annual report' })
).toBeVisible();
await page.screenshot({ path: 'report.png' });

Keep the destination assertion after the wait so the capture is gated on the content, not just the URL.

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

Wait for an SPA route or in-page content update

A client-side route can update the page without a traditional document navigation; some interactions change visible content without changing the URL at all. In those cases, do not wait for a document navigation just because a link was clicked. Assert the intended post-click state instead:

await page.getByRole('link', { name: 'Open report' }).click();
await expect(
  page.getByRole('heading', { name: 'Annual report' })
).toBeVisible();
await page.screenshot({ path: 'report.png' });

Choose an assertion that distinguishes the ready state from the pre-click page, a spinner, or an empty shell—for example, the new heading, a report-specific table, or a success message. Playwright’s locator assertions retry until the condition is met or the assertion times out. Click actionability checks—uniqueness, visibility, stability, receiving events, and enabled state—apply to the clicked target; they are not a later assertion that the application’s content update has completed. See the actionability guide and test assertions.

Choose the wait that matches the behavior

What the click does Synchronize on Then capture when
Loads a different document at a known destination page.waitForURL() A meaningful destination locator is visible
Changes an SPA route or updates content in place A web-first assertion for the expected locator or state The new content assertion passes
Runs a Playwright Test visual comparison The intended post-click page state, then expect(page).toHaveScreenshot() The screenshot assertion is made in the test runner

These approaches solve different synchronization problems; there is no single wait that proves every application is ready.

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.

Why generic waits often fail

Prefer waitForURL() to waitForNavigation()

The Page API marks page.waitForNavigation() deprecated and says, “This method is inherently racy, please use page.waitForURL() instead.” Use the URL wait for a known main-frame destination, followed by a content assertion. Playwright Page API

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.

Do not use networkidle as proof of rendered content

The API defines networkidle as no network connections for at least 500 ms, but discourages using it for tests and recommends relying on web assertions. A quiet network does not establish that the particular heading, image, or data your capture needs is visible. Playwright Page API

A fixed sleep is not a readiness condition

page.waitForTimeout() is discouraged for production tests; Playwright says it should only be used for debugging because timer-based tests are flaky. An arbitrary delay can make a test slower and still leave it racing a slow or variable render. Replace it with an assertion about the intended state. Playwright Page API

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • 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

Troubleshoot when the wait or capture still looks wrong

  • The URL did not change: Check whether the link is supposed to change routes, reveal content in place, or open another page. If the expected behavior is an in-page update, wait for that content rather than a new URL.
  • The URL changed but the capture is blank: Confirm the URL pattern is the intended destination, then assert a destination-specific element before capture. A URL match alone can be too weak a readiness signal.
  • The URL wait never resolves: Verify the expected pattern against the actual URL after the click. If the app uses client-side state without a main-frame URL change, switch to a content assertion.
  • The click seems to do nothing: Check whether the expected target is actionable and whether the app has finished hydrating. Playwright’s navigation guide says poor page hydration is a probable reason an action may appear to do nothing in the scenario it describes; it is a possibility, not a diagnosis of every blank screenshot. Navigation guide
  • A new tab was expected: Make sure the test captures the Page that actually received the link’s result. A wait on the original page cannot establish readiness of a separate page.
  • The assertion passes but the screenshot remains visually unstable: Check whether changing content such as animation, timestamps, or asynchronously updated data is still moving. Keep the destination-state assertion, then apply screenshot-specific controls appropriate to your test rather than replacing the readiness check with a sleep.
  • Behavior differs across installations: Check the Playwright version installed in the project and consult the documentation matching that release. The navigation guide may be served from a /next/ path, so verify that its details apply to your version.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use screenshot assertions for visual comparisons

In Playwright Test, await expect(page).toHaveScreenshot() waits until two consecutive page screenshots match before comparing the result with the expectation. This is a test-runner assertion, not a generic replacement for selecting the right post-click readiness condition. First wait for the destination state; otherwise a stable blank page can become the screenshot result. Screenshot assertions work with the Playwright test runner. Visual comparisons

Or skip the browser setup

If you need a screenshot of a URL rather than a browser automation test, ScreenshotNeo can return an image or PDF with one GET request. Its API accepts cookie-consent banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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 API documentation for setup and options. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo free.

Frequently Asked Questions

Does page.screenshot() wait for navigation to finish?

A click that triggers navigation waits for navigation to happen and loading to start, but that does not guarantee the specific content intended for the screenshot has rendered. Gate the capture on the destination state.

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.

Can I use waitForURL() for an SPA?

Use it if the SPA changes the main-frame URL and that URL is the condition you need. If the route or content changes without a useful URL change, assert the expected page content instead.

Does toHaveScreenshot() wait for my page content to appear?

It waits for consecutive screenshots to match for a visual comparison; it does not replace a post-click assertion that the intended page content is present.

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

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.