October 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 NowOctober 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

How to Test Lazy-Loaded Page Screenshots Across Desktop Viewport Sizes

Test desktop visual screenshots reliably by scrolling lazy-loaded content into view, checking image readiness, and keeping viewport and rendering settings consistent.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Test lazy-loaded screenshots by capturing each supported desktop CSS viewport separately, scrolling deferred content into view, and waiting for the relevant images to load before comparing screenshots. A page’s load event alone is not enough: lazy images can still be pending when it fires.

Choose desktop viewport sizes that match your breakpoints

A viewport is the browser’s CSS layout width and height, not the screenshot’s physical pixel dimensions. Select explicit sizes that exercise the desktop breakpoints your product supports. For example, a test set might include 1280×800, 1440×900, and 1920×1080, but use your own supported widths rather than treating those examples as universal standards.

As an Amazon Associate I earn from qualifying purchases.

Keep viewport dimensions distinct from device scale factor. The viewport determines layout; device scale factor affects how many output pixels represent a CSS pixel. Playwright can emulate device settings and override viewport dimensions. See Playwright emulation.

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

Run a visual screenshot test at each size

Use one test case per viewport or parameterize a test with explicit dimensions. Set the viewport before navigating, bring the lazy-loaded section into view, and wait for the images you expect to appear to report successful loading.

#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';

for (const viewport of [
  { width: 1280, height: 800 },
  { width: 1440, height: 900 },
  { width: 1920, height: 1080 },
]) {
  test(`visual at ${viewport.width}x${viewport.height}`, async ({ page }) => {
    await page.setViewportSize(viewport);
    await page.goto('/gallery');

    const lazySection = page.locator('[data-testid="below-fold-gallery"]');
    await lazySection.scrollIntoViewIfNeeded();

    const images = lazySection.locator('img');
    await expect.poll(async () => images.evaluateAll((nodes) =>
      nodes.every((node) => {
        const image = node as HTMLImageElement;
        return image.complete && image.naturalWidth > 0;
      })
    )).toBe(true);

    await expect(page).toHaveScreenshot(
      `gallery-${viewport.width}x${viewport.height}.png`
    );
  });
}

Replace /gallery and the test ID with your route and selector. This is an illustrative pattern, not a guarantee that every site’s lazy loader works the same way. If images are inserted after the section first renders, or if the page uses a nested scroll container, adapt the trigger and readiness check accordingly.

What the image check establishes

The check requires every matching image to be complete and have a nonzero natural width, which helps distinguish loaded images from broken or still-pending ones. If your application exposes a reliable loaded-state marker, waiting for that marker can be more precise. For content that shifts as images arrive, also wait for the target layout to settle before capturing.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • 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

Give snapshots unambiguous names

Include the viewport dimensions in the screenshot name, such as gallery-1280x800.png. This makes it clear which layout a baseline represents and helps prevent comparisons between different viewport configurations.

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

Test the lazy-loading behavior, not just the final image

Native loading="lazy" defers an image until it is within a browser-calculated distance of the viewport. JavaScript-based loaders often use Intersection Observer or a similar visibility trigger; Intersection Observer can use the viewport or a configured root, and a positive rootMargin can start loading before an item is visibly onscreen. See MDN’s <img> reference and MDN’s Intersection Observer documentation.

Rank #3
Acer 27in FHD 1920x1080 IPS 120Hz Gaming Monitor | Office KB272 G0bi | 1ms, AdaptiveSync, sRGB 99%, HDMI, VGA, VESA Mountable, Bluelight Filter
  • Incredible Images: The Acer KB272 G0bi 27" monitor with 1920 x 1080 Full HD resolution in a 16:9 aspect ratio presents stunning, high-quality images with excellent detail.
  • Adaptive-Sync Support: Get fast refresh rates thanks to the Adaptive-Sync Support (FreeSync Compatible) product that matches the refresh rate of your monitor with your graphics card. The result is a smooth, tear-free experience in gaming and video playback applications.
  • Responsive!!: Fast response time of 1ms enhances the experience. No matter the fast-moving action or any dramatic transitions will be all rendered smoothly without the annoying effects of smearing or ghosting. A 120Hz refresh rate speeds up the frames per second to deliver smooth 2D motion scenes in gaming and video.
  • 27" Full HD (1920 x 1080) Widescreen IPS Monitor | Adaptive-Sync Support (FreeSync Compatible)
  • Refresh Rate: Up to 120Hz | Response Time: 1ms VRB | Brightness: 250 nits | Pixel Pitch: 0.311mm

If the behavior itself matters, check that the image remains unloaded before scrolling it near view, then verify the loaded state after scrolling. If the observer is rooted in a nested scrolling element, scroll that element rather than the page window. For a gallery extending beyond one screen, use multiple scroll steps or test each relevant section; a single scroll to one target does not exercise every deferred image.

Choose viewport capture or full-page capture for the assertion

A viewport screenshot tests what a user sees in the visible browser area at a given width and height. A full-page screenshot captures the scrollable document. Use viewport capture for viewport-specific visual regression; choose full-page capture when the whole document’s output is what you need to validate. These capture modes answer different questions, and a full-page image should not replace checks at explicit desktop viewport sizes.

Rank #4
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.

Playwright’s screenshot documentation describes both viewport and full-page capture, and the scale option can produce CSS-pixel or device-pixel output. See Playwright Screenshots.

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

Keep screenshot comparisons reproducible

Playwright’s toHaveScreenshot() creates a reference image on first use. On later runs, its matcher takes screenshots repeatedly until two consecutive captures match, then saves the last one for comparison. Keep the browser and rendering environment consistent between baseline creation and later runs: rendering can vary with host OS, browser version, settings, hardware, power source, and headless mode. See Playwright visual comparisons.

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.
  • Run baseline generation and comparisons with the same browser version and environment.
  • Use the same viewport dimensions and device scale factor for each named baseline.
  • Ensure images have reserved dimensions where practical; MDN recommends width and height for lazy-loaded images to reduce layout shifts.
  • Do not treat an arbitrary pause as proof that images loaded. Prefer an image-level or application-owned readiness condition.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why images are missing from a full-page screenshot

Lazy images may not have loaded when the browser’s load event fires, because they have not yet approached the browser’s loading threshold. A full-page capture is not, by itself, proof that every lazy-loading trigger was reached. Scroll relevant content into or near view, wait for its images to load, and only then capture. MDN documents both the lazy-loading behavior and the fact that the load event can fire while lazy images remain unloaded: MDN Lazy loading.

Common failures and fixes

The test times out waiting for images

  • Check whether the selector matches any images. An empty set can make a broad readiness condition misleading; assert the expected image count if the page has a known target.
  • Check for failed image requests or an incorrect source URL. A broken image does not satisfy naturalWidth > 0.
  • Scroll the correct element. If a nested container is the observer root, scrolling the window may not trigger the load.
  • For images added dynamically, wait for the application’s render condition before collecting or checking the final image set.

The screenshot contains the images but still differs between runs

Check for layout shifts, animations, changing content, and differences in browser or host environment. Wait for a meaningful stable state in the application and keep the environment aligned with the baseline rather than relying only on a fixed delay.

A full-page capture omits content farther down

Trigger loading by scrolling through the relevant sections before capture. If the purpose is to test each viewport layout, take viewport screenshots at each chosen size instead of treating one full-page image as a substitute.

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

Or skip the browser setup

If you need an image capture without building this browser workflow, ScreenshotNeo accepts one GET request with a URL and returns a PNG, JPEG, WebP, or PDF. Its capture options include full-page screenshots with lazy images loaded, viewport selection, CSS selectors, and waits for a selector, delay, or network idle. This API call saves a WebP screenshot:

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 request options. Before a capture, it accepts cookie or consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. ScreenshotNeo also provides an MCP server for AI agents, with tools including take_screenshot, get_page_info, and capture_pdf.

Free includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.

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.

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

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

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.