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 DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

How to Test Dropdown Menus with Visual Regression Screenshots

A reliable dropdown screenshot test opens the menu through a real interaction, checks its behavior, and compares a reviewed visual baseline under consistent rendering conditions.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a browser test to open the dropdown through a real user interaction, assert that it opened correctly, and then compare a screenshot of that state with a reviewed baseline. With Playwright Test, toHaveScreenshot() can catch visual changes while functional assertions check that the menu still behaves as expected.

Build a Playwright test that opens and captures the dropdown

The example below assumes a button named “Account options” opens a menu containing a “Profile” item. Adjust the accessible roles and names to match your component; a native <select>, for example, does not necessarily use the ARIA menu/menuitem pattern.

As an Amazon Associate I earn from qualifying purchases.

import { test, expect } from '@playwright/test';

test('dropdown opens and matches its visual baseline', async ({ page }) => {
  await page.goto('/settings');

  const trigger = page.getByRole('button', { name: 'Account options' });
  await expect(trigger).toBeVisible();
  await trigger.click();

  const menu = page.getByRole('menu');
  await expect(menu).toBeVisible();
  await expect(menu.getByRole('menuitem', { name: 'Profile' })).toBeVisible();

  await expect(page).toHaveScreenshot('account-menu-open.png');
});

This is an illustrative pattern, not a tested application-specific test. Use the roles and assertions that correspond to your app’s semantics. Playwright’s screenshot assertions create a reference image if one does not exist and compare later captures against it; the first reference must be reviewed rather than accepted automatically. See Playwright’s visual comparisons documentation.

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

Choose the right screenshot scope

toHaveScreenshot('account-menu-open.png') captures the page. If the dropdown’s own bounds are the only subject, a locator screenshot assertion can make the comparison more focused. Choose a scope that still includes any nearby layout whose movement would be a meaningful regression, such as a menu overlapping or displacing adjacent content. Playwright documents screenshot options and styling in its Page API.

#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • 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

Cover states that matter

A closed-menu image cannot catch an error that appears only after opening the menu. Decide which states users and the implementation actually require, then capture those deliberately:

  • Closed: useful when trigger styling or layout is important.
  • Open: check menu geometry, content, layering, and alignment.
  • Selected or expanded: include this when the component presents a selected item or nested content.
  • Keyboard, disabled, error, or responsive states: add only when they are relevant to this component’s expected behavior.

Keep functional checks alongside screenshots. Assert visibility, expected text, selected state, focus, or the interaction outcome as appropriate; an image comparison alone does not establish that the control works.

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

Make screenshot comparisons repeatable

Visual baselines are useful only when ordinary rendering variation does not swamp meaningful changes. Playwright notes that rendering can vary with host OS, browser version and settings, hardware, power state, and headless mode. Generate and compare screenshots in a consistent environment; see its guidance on visual comparisons.

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

Control interaction and loading

  • Set the pointer intentionally. A screenshot can include hover styling at the pointer’s current position. Move it away when hover is not part of the target state, or deliberately hover the trigger for a hover-open menu. Playwright’s snapshot documentation discusses pointer positioning.
  • Wait for a condition, not an arbitrary delay. Assert that the menu and expected content are visible. If fonts, icons, or data load asynchronously and affect the image, make the test wait for the relevant content to be ready.
  • Capture intermediate states before changing them. If a test continues to select an item or close the menu, take the open-state snapshot immediately after asserting that state.
  • Keep the rendering setup steady. Use consistent viewport, browser, operating-system or container image, color scheme, and device scale between baseline creation and comparison.

Handle genuinely dynamic content carefully

Timestamps, randomized values, and rotating content can cause noise unrelated to the dropdown. Playwright supports a screenshot stylesheet through stylePath to hide or change volatile elements. Apply such styling narrowly: do not mask the menu or meaningful nearby layout, because that would hide the regression the test is meant to detect. Consult the Page API for screenshot options.

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

Set thresholds only after inspecting the cause

Playwright supports screenshot comparison settings including difference thresholds and maxDiffPixels. First identify why pixels differ; only then decide whether a threshold is appropriate. A permissive threshold can conceal a real layout or styling defect. When a UI change is intentional, run npx playwright test --update-snapshots, inspect the changed references, and commit only the reviewed baselines.

Choose local snapshots or hosted visual review

Playwright’s built-in assertions are the direct option when local reference files and the team’s existing test workflow are enough. Hosted services may suit teams that want a shared review interface, cloud snapshot workflow, or capture of named intermediate states. Chromatic documents a Playwright setup and targeted snapshots; Percy provides a Playwright client. Evaluate current availability, terms, and cost with each provider; no prices or program terms are established here.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • 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

Whichever workflow you choose, keep the test’s browser and rendering environment consistent and make baseline review part of the change process. Hosted review changes how a team shares and reviews captures; it does not replace assertions that the dropdown opens and behaves correctly.

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.

Troubleshoot common screenshot-test failures

Symptom Likely cause What to check
The snapshot shows the menu closed. The test captured before opening it, or used a state-changing flow without capturing the intermediate state. Click or hover the trigger, assert the menu is visible, and capture before continuing.
The screenshot differs on different machines or CI runs. Browser, host, headless mode, device scale, or other rendering settings differ. Align the browser and host image, viewport, color scheme, and device scale used for the baseline and comparison.
Only hover colors or outlines differ. The pointer is in a different location at capture time. Move the pointer to a deliberate location or explicitly hover the trigger if that is the state under test.
Text, icons, or menu content sometimes appear incomplete. Relevant fonts, assets, or data were not ready when capture occurred. Wait for a meaningful visibility or readiness condition before the screenshot assertion.
Diffs appear in unrelated timestamps or rotating content. Volatile UI changes between captures. Stabilize the data where possible or use narrowly scoped screenshot styling; leave the dropdown and relevant layout visible.
A baseline update hides a regression. A new reference was accepted without reviewing the visual change. Inspect each updated image and its diff before committing the reference.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For a one-off screenshot rather than an interaction-driven regression test, ScreenshotNeo returns an image or PDF from one GET request. This cURL example captures a page; it does not click a dropdown or replace Playwright assertions and baselines.

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.
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 request options. ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, and cache hits are not billed. Its MCP server lets AI agents use screenshot tools. The free plan includes 1,000 shots per month with no card, and paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month without a card.

Frequently Asked Questions

Should I take a screenshot of the whole page or only the dropdown?

Use a page screenshot when surrounding layout and overlap matter; use a locator screenshot when the component alone is the intended comparison. Keep any nearby layout that is part of the regression risk in scope.

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

Does ScreenshotNeo replace a Playwright visual regression test?

No. Its screenshot API captures a page from a URL, while an interaction-driven Playwright test opens the menu, asserts behavior, and compares a reviewed baseline.

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.