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

For a repeatable web UI screenshot, use Playwright: capture the viewport for the visible state, the full page for below-the-fold review, or a locator for one component. Set the page to a known state before capturing, then keep the browser and machine conditions consistent when comparing images. The examples below use Playwright’s JavaScript API and produce image files you can inspect or attach to tests.

Choose what the screenshot needs to show

A web UI screenshot records rendered pixels, not the page’s underlying structure. Decide what question the image should answer before choosing its scope:

  • Viewport: Capture the currently visible screen when checking a fold, a dialog, or a responsive layout at a particular size. Content outside the viewport is not included.
  • Full page: Capture the full scrollable page for long-page review or documentation. Playwright describes this as a screenshot of the full scrollable page, as if the page fit on a very tall screen (Playwright screenshot documentation).
  • Element: Capture a specific locator when reviewing or documenting a component without the rest of the page.

For visual inspection, screenshots can also help verify layout and canvas or chart content. They do not establish that controls work, that the page is accessible, or that its DOM has the expected structure; use accessibility snapshots or DOM-oriented checks for those questions.

Capture a web UI screenshot with Playwright

Install Playwright’s test package in a Node.js project and install a browser. These commands create a minimal project using the Chromium browser:

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.
#1 Best Overall
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS
  • 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
  • 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
  • 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
  • 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
  • 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0
  1. npm init -y
  2. npm install --save-dev @playwright/test
  3. npx playwright install chromium

Save the following as screenshot.spec.js. It captures the viewport, the full page, and one element. Replace the example URL and locator with your own page and component.

const { test, expect } = require('@playwright/test');

test('capture web UI screenshots', async ({ page }) => {
  await page.setViewportSize({ width: 1440, height: 900 });
  await page.goto('https://example.com', { waitUntil: 'networkidle' });

  // Wait for a meaningful page landmark before capturing.
  await page.locator('body').waitFor({ state: 'visible' });

  await page.screenshot({ path: 'viewport.png' });
  await page.screenshot({ path: 'full-page.png', fullPage: true });

  const main = page.locator('main');
  await expect(main).toBeVisible();
  await main.screenshot({ path: 'main-element.png' });
});

Run the test with npx playwright test screenshot.spec.js. Playwright writes the requested files in the test’s output area. The exact output directory depends on the test-runner configuration; set a project-specific output directory if another process expects a fixed path.

Wait for the right page state

A successful navigation does not guarantee that the image represents the state you intend. The page may fetch content after load, animate into place, or depend on user interaction. Wait for a stable, meaningful condition—for example, a result heading or an element that appears only after the application has finished loading. Use a deliberate wait when the state is time-based, and avoid relying on arbitrary long sleeps when the page exposes a better signal.

waitUntil: 'networkidle' is useful for pages whose relevant work settles after network activity, but it is not a universal definition of “ready”: applications with persistent connections or ongoing polling may never become idle. In those cases, navigate using an appropriate load condition and wait for a specific selector or application state.

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.
Rank #2
Capture Card, 4K HDMI Video Capture Card, Game Capture Card, 1080P 60FPS Video Capture Device, HDMI to USB 3.0 Capture Card for Streaming, Work with Camera/Xbox/PS4/PS5/PC/OBS
  • 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
  • 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
  • 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
  • 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
  • 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.

Capture an element safely

Use a locator that identifies one intended component, preferably by a stable role, label, test ID, or selector chosen for the application. A missing or ambiguous locator can make the test fail or target the wrong content. The example checks visibility before taking the element screenshot; add assertions for the component’s expected text or state when that matters to the review.

Pick the image format and scale

Playwright’s page screenshot API writes an image file or can return image bytes for further processing. The Playwright MCP screenshot tool documents PNG, JPEG, and WebP, and allows choosing CSS-pixel or device-pixel scaling (Playwright MCP tools).

  • PNG: A practical default for UI review and regression images, especially where sharp edges and text matter.
  • JPEG: A lossy format that can reduce file size for photographic content. It does not support transparency.
  • WebP: Available in the MCP screenshot tool; choose it when the receiving workflow supports it.

Use CSS-pixel scale when you want output dimensions to track the page’s CSS layout. Device-pixel scale produces pixels at the device scale and can create larger images. For consistent comparisons, keep scale and viewport settings identical across runs. The page screenshot API also supports a transparent background where applicable; transparency is unavailable for JPEG (Playwright page screenshot API).

Keep bytes in memory for processing

If a downstream step needs image bytes rather than a file, omit the path and store the returned buffer. For example, this test captures a locator and writes the returned bytes to a chosen location:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Capture Card, USB Video Capture Card Device, Audio Video Converter Grabber for RCA to USB-Convert VHS Mini DV VCR Hi8 DVD to Digital, for PC TV Tape Player Camcorder, MAC Windows Vista Compatible
  • AV TO USB Converter: Capture videos and audios from VHS, VCR, Hi8, DV tapes to a PC, with the help of our USB Video Converter. Save room while digitizing your favorite old memories
  • Quality Capture Card: Our USB Video Capture Card converting anolog RCA composite input into HD 720P USB output and capturing audio without any sound card. Advanced signal processing technology provides you with great precision, colors, resolutions, and details.
  • Plug and Play: Automatically install the driver once you hook up this RCA to USB Converter to a PC. No external power is needed. User-friendly and easy to operate
  • Wide Compatibility: The Video Capture Card can work with video devices with RCA connector or S-Video connector, such as VHS, VCR, Hi8, camcorder, compatible with Windows and Mac OS. Support video formats like NTSC, PAL, and support brightness, contrast, hue, and saturation control
  • Note: The Video Converter is used with acquisition software. We recommend OBS Studio or PotPlayer for Windows, and QuickTime Player for Mac. They can be downloaded for free online. Please operate according to the steps in User Manual or contact us if you have any questions
const fs = require('node:fs/promises');
const { test } = require('@playwright/test');

test('capture bytes for processing', async ({ page }) => {
  await page.goto('https://example.com');
  const image = await page.locator('main').screenshot({ type: 'png' });
  await fs.writeFile('main.png', image);
});

Make visual comparisons more reliable

A screenshot difference is evidence that rendered pixels changed; it is not, by itself, proof of a functional defect or accessibility problem. A real UI change may cause the difference, but so can changes to the browser or machine rendering environment.

Keep the environment stable

Playwright’s visual comparison documentation cautions that host operating system, browser version, settings, hardware, power source, and headless mode can affect rendering (Playwright visual comparisons). For useful baselines, keep these conditions consistent between baseline creation and comparison runs:

  • Browser and browser version, operating system, and headless or headed mode.
  • Viewport dimensions, device scale, and any device-emulation settings.
  • Fonts, installed dependencies, and page data that affects layout.
  • Network-dependent content, locale, timezone, and other state that changes visible text or formatting.
  • Animation and transition behavior.

When possible, run both baseline and comparison captures in the same controlled environment rather than assuming screenshots from different machines are pixel-identical.

Control animation and unstable regions

Animations, blinking cursors, rotating banners, timestamps, and live data can change pixels even when the UI code has not changed. Playwright’s screenshot assertion API can wait for consecutive screenshots to stabilize and configure animation handling (Playwright screenshot assertions). Prefer stabilizing the page or disabling nonessential animation for the test. Where a region is inherently variable or sensitive, the page screenshot API supports masking selected locators; the mask overlays their bounds, so it is a visual-comparison aid rather than content removal (Playwright page screenshot API).

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

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request returns a screenshot or PDF; use the API when you want to avoid installing and managing a browser for a capture. The parameter names used by other screenshot APIs also work, which can make switching easier. See the ScreenshotNeo website and API documentation.

Rank #4
Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P60FPS HDMI Capture Card for Streaming, Gaming, Video Recording Compatible with Switch, Xbox, PS4/5, OBS,iPad Mac OS Windows,Camera, Zoom(Silver)
  • 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
  • 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
  • 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
  • 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
  • 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Replace YOUR_API_KEY with your key and the URL with the page to capture. The API also supports PNG and JPEG output. ScreenshotNeo removes known consent banners, newsletter popups, and chat widgets before capture; those steps can each be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to AI agents and other MCP clients.

The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Plans include the same features. Sign up for ScreenshotNeo’s free plan to start capturing.

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

Troubleshoot common screenshot problems

The screenshot is blank or shows a loading state

Check that navigation reached the expected URL and that the page’s content is visible before capture. If your app renders after initial navigation, wait for a meaningful selector or state. A page that depends on authentication, blocked requests, or a failed API call may never reach the expected state; inspect the test’s page errors and network behavior rather than adding a longer fixed delay blindly.

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

The full-page image is unexpectedly tall or incomplete

Full-page capture represents the page’s scrollable content at capture time. Confirm that content has loaded and that lazy-loaded sections are present before capturing. If loading images or sections requires scrolling, trigger that behavior first and wait for the content you need to appear. For a component-only review, use an element screenshot instead of capturing a long page.

The element screenshot fails

Verify that the locator matches the intended element and that it is attached and visible. If a dialog or component appears only after an action, perform that action first and wait for the resulting state. Narrow a broad selector when it matches more than one element.

Best Value
VIXLW 4K HDMI Video Capture Card, Cam Link Card, HDMI to USB 2.0 Game Audio Adapter, Record Capture Device for Streaming, Teaching, Gaming, Live Broadcasting, Video Conference [Windows]
  • 【4K VIDEO CAPTURE CARD】Made with upgraded chip, captures 4K@60Hz video input at full speed, no lag, no delay, capture card also supports 1920×1080@30Hz highest image quality output, capture video to USB through HDMI, you can Directly save to computer and mobile phone; suitable for high-definition video live broadcast, video capture, online conference, video streaming, video course; equipped with high-definition USB cable.
  • 【HDMI real-time screen sharing】The HDMI interface is made of nano-metal material, so that the video can reach ultra-low latency. The audio and video capture card can capture video and audio at the same time, and store the video signal into the computer and smartphone, and support OBS post-video. Editor, this is an excellent solution for online meetings and live broadcasts, economical and fast, 4K HDMI Capture Card is widely used in live broadcast, conference, photography, medicine, daily office.
  • 【Plug and Play】4K video capture card has built-in drivers, no need to install complicated programs, no external power supply, plug and play, very convenient, just plug into your computer, you can use it, the shell is made of aluminum alloy seamlessly , small size, very convenient to carry, suitable for capturing interesting details in life, can be used for indoor and outdoor live broadcast, and the color of the picture is more delicate.
  • 【Wide Compatibility】The video capture card adopts advanced chips, intelligent identification equipment, and is widely compatible with electronic equipment, which can easily capture wonderful moments and comes with a USB cable. It supports third-party video capture software such as OBS, Win, MacOs, Android, etc. It can also perform video capture and online live broadcast at the same time, store and share videos at the same time, and easily realize video splicing, which is very convenient.
  • 【24 hours local technical support】We have a professional technical team for more than ten years, serving you 24 hours a day. You are welcome to contact us if you have any questions.

Visual diffs appear without an obvious UI change

Compare browser version, operating system, viewport, scale, headless mode, and other rendering conditions between runs. Look for animation, dynamic text, live content, and fonts that may differ. Stabilize or mask only the regions that are genuinely variable; do not mask broad parts of the page simply to suppress meaningful changes.

The test waits forever for network idle

Some pages keep network requests active through polling or persistent connections. Use a navigation condition that fits the app and then wait for a specific element or state that signifies readiness. A selector-based readiness check is generally more meaningful than treating all network activity as relevant.

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

Performance, reliability, and cost considerations

Capturing only the needed scope keeps artifacts easier to review: a viewport image is generally more focused than a full-page image, while full-page capture can be useful when below-the-fold content is part of the question. Reusing a configured browser in an automated test suite avoids repeating setup for every capture. For test reliability, keep inputs and rendering conditions fixed, and treat failed readiness checks as test failures rather than silently saving a misleading image.

Playwright is a do-it-yourself browser automation approach: you manage the runtime, browser installation, test environment, and artifact storage. ScreenshotNeo is a hosted alternative billed only for clean shots under the stated billing behavior above; its cache hits are not billed. Choose according to whether you need local control and test-runner integration or a direct screenshot API and MCP tools.

For automated visual regression, keep image baselines under a review process: inspect meaningful differences, update baselines only when the visual change is intended, and investigate environment drift before accepting broad pixel changes. A screenshot comparison cannot substitute for functional tests, accessibility checks, or DOM assertions.

Frequently Asked Questions

Can a screenshot prove that a page is accessible?

No. A screenshot shows appearance; use accessibility snapshots and appropriate interaction checks to inspect structure and behavior.

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

Can I take a screenshot of just one component?

Yes. Playwright can capture a locator, as in the element example above.

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.