The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →A Playwright screenshot can be taken before a lazy-loaded image has been requested, loaded, and painted. Waiting for the page’s load event—or asking for a full-page screenshot—does not guarantee that off-screen images are ready. Scroll the images you need into view, wait for an image-specific ready condition, and then capture.
Why lazy-loaded images are missing
Lazy loading postpones image requests until the browser or application decides they are needed, often when they approach the viewport. A screenshot can therefore arrive before the trigger or before the resulting image is ready to display. If the first run is blank but later runs work, a timing race is plausible; the symptom alone does not prove that caching is the cause.
As an Amazon Associate I earn from qualifying purchases.
Document lifecycle events and image readiness are different conditions. Playwright’s waitForLoadState('load') waits for the document’s load event, while DOMContentLoaded occurs earlier. Neither says that every image deferred until later scrolling has loaded. Playwright also notes that many actions already auto-wait and discourages using networkidle as a general test-readiness signal. See the Playwright Page API.
Make the screenshot wait for the images it needs
- Identify the target images. Check whether the blank images are below the initial viewport, inside a scrolling container, or inserted or updated by client-side code. The right selector and loading trigger depend on the page.
- Inspect their state. Before and after scrolling, examine attributes and properties such as
src,srcset,currentSrc,loading,complete, andnaturalWidth. This helps distinguish an image that has not been requested from one whose request failed. - Trigger the site’s loading behavior. Scroll each target image or its containing section into view. For a custom lazy loader, use the user-visible event the application expects; scrolling is not universal.
- Wait for a content-level condition. For a normal image, a positive
naturalWidthis one useful success condition. If the application exposes a more specific loaded marker, prefer that. Avoid replacing the condition with a fixed sleep or genericnetworkidlewait. - Capture after the condition passes. Use full-page capture if you need the full scrollable extent, but treat capture extent and image readiness as separate concerns.
Adaptable JavaScript example
This Playwright Test example scrolls images marked with loading="lazy" into view, waits for a nonzero natural width, and then takes a full-page screenshot:
#1 Best Overall
- 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 page after lazy images load', async ({ page }) => {
await page.goto('https://example.com');
const images = page.locator('img[loading="lazy"]');
const count = await images.count();
for (let i = 0; i < count; i++) {
const image = images.nth(i);
await image.scrollIntoViewIfNeeded();
await expect(image).not.toHaveJSProperty('naturalWidth', 0);
}
await page.screenshot({ path: 'page.png', fullPage: true });
});
Replace the example URL and selector with the target page’s values. This is a pattern, not a guaranteed drop-in fix: a site may use custom attributes or JavaScript instead of loading="lazy", and its matching image list may change while the test runs. The Playwright issue example demonstrates scrolling and checking naturalWidth, while also noting that locator.all() returns immediately and can be unpredictable for a changing list: Playwright issue #31737.
Full-page screenshots and visual assertions
A full-page screenshot determines how much of the page is captured; it does not itself establish that every lazy image has loaded. For visual regression tests, Playwright’s toHaveScreenshot waits for two consecutive screenshots with the same result before comparing. Use that stabilization after triggering and checking the application state, not instead of doing so. The API is documented in Playwright PageAssertions.
Rank #2
- 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
Choose a readiness check that matches the page
| Approach | What it establishes | Limitation |
|---|---|---|
Wait for document load |
The document reached its load event. | Does not establish that deferred, off-screen images are ready. |
Wait for networkidle |
A period of network quiet. | Playwright discourages it as a generic testing-readiness strategy; it does not assert the state of the target image. |
| Scroll and assert image or app state | The test has triggered the relevant content and can check the image it needs. | Requires a correct locator and a condition that reflects the page’s actual loading behavior. |
| Fixed timeout | Only that a chosen amount of time elapsed. | Can be unnecessarily slow or still too short; it does not prove successful loading. |
Troubleshoot when the image is still blank
The image has no real URL
Inspect src, srcset, currentSrc, and any application-specific data attributes. Some sites assign the actual URL only after a trigger. If the URL is absent, adjust the trigger or selector rather than waiting longer for a request that has not started.
Outdated 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 matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallThe image request fails
Check browser console messages and failed network requests. A request failure is different from taking the screenshot too early; investigate the resource URL, response, or browser conditions before changing screenshot timing.
Rank #3
- 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.
The image reports loaded but appears blank
Check whether CSS hides it or makes it transparent, whether an overlay covers it, whether it has been decoded and painted, and whether the screenshot targets the intended frame or element. A nonzero naturalWidth is evidence of an image resource, not proof that the visible result is correct.
Only the first run fails
Compare cold and warm runs while logging image state before and after scrolling. Later runs may benefit from cache or page state, but the symptom does not identify either as the cause. Keep the same viewport and target conditions so the comparison is useful.
Rank #4
- 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
The image list changes while the test loops
A list collected before scrolling may no longer match the current DOM if the page inserts or removes images. Re-evaluate the locator as needed or wait for the application’s list to stabilize. The GitHub issue cited above illustrates this risk; it does not mean every dynamic page will fail the same way.
Free tools Windows power users keep installed
One-click scans. No signup required.
The visual assertion is flaky
First ensure the app and intended images are ready. Then use toHaveScreenshot for its documented consecutive-screenshot stabilization, and account for other changing visual elements separately. Screenshot stabilization cannot trigger lazy loading or fix a failed image request.
Best Value
- 【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.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a screenshot or PDF; cookie banners, newsletter popups, and chat widgets are removed before capture, and those cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed; response headers report the page verdict and billing status. Its MCP server gives AI agents tools to take screenshots, inspect page information, and capture PDFs.
Example cURL request (replace the URL with the page you want to capture):
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 setup and options. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free and try 1,000 screenshots a month with no card.
Frequently Asked Questions
Does Playwright’s full-page screenshot option load lazy images automatically?
No. It controls the captured page extent, not whether the page’s lazy-loading behavior has run or whether each image is ready.
Is waiting for `load` enough before a screenshot?
Not for every lazy-loaded image. The document’s load event is not a condition that each deferred image has loaded.
Quick Recap
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.




