To show a hover menu in a website screenshot, move the pointer over its trigger, wait until the menu is visibly open, and capture the page before moving the pointer away. With Playwright, use a locator’s hover() method and then take a viewport or element screenshot. Choose a crop that shows the entire menu and enough surrounding navigation to make its location clear.
Capture a hover menu with Playwright
This JavaScript example opens a page, hovers a navigation link, waits for a menu selector to become visible, and saves a screenshot. Replace the URL, accessible name, and menu selector with values from the site you are documenting.
As an Amazon Associate I earn from qualifying purchases.
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
try {
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await page.getByRole('link', { name: 'Products' }).hover();
await page.locator('[data-testid="products-menu"]').waitFor({ state: 'visible' });
await page.screenshot({ path: 'products-menu.png' });
} finally {
await browser.close();
}
})();
The hover action scrolls the target into view if necessary and moves the pointer over it. Waiting for the menu itself is more robust than choosing an arbitrary sleep duration: sites may open instantly, animate, or load menu content after interaction. The locator and label above are illustrative; they must match the page.
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 matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Playwright’s official documentation covers page and locator APIs, screenshots, visual comparisons and hover effects, and interactions. These are living documentation pages; check the API for the Playwright version installed in your project.
#1 Best Overall
- Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
- Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
- Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
- Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
- Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)
Choose the screenshot crop
- Viewport: Use a regular page screenshot when the open menu and useful page context fit on screen. The pointer remains on the trigger during capture, so the hover state is present.
- Element: Capture a navigation container or other relevant element for a close-up. Verify that its bounds include the complete menu, including any content extending beyond the trigger.
- Full page: Use this for a long page when the documentation needs the whole document. A full-page capture does not guarantee that every transient hover state will remain open as the page is captured; inspect the output rather than assuming the menu is intact.
For example, to save just a navigation region, use an appropriate selector after opening the menu:
await page.getByRole('link', { name: 'Products' }).hover();
await page.locator('header nav').screenshot({ path: 'navigation-menu.png' });
Review the saved image at its intended display size. Check that the menu is fully visible, the pointer does not cover important text, and the crop still shows where the menu came from.
Rank #2
- The next-generation optical HERO sensor delivers incredible performance and up to 10x the power efficiency over previous generations, with 400 IPS precision and up to 12,000 DPI sensitivity
- Ultra-fast LIGHTSPEED wireless technology gives you a lag-free gaming experience, delivering incredible responsiveness and reliability with 1 ms report rate for competition-level performance
- G305 wireless mouse boasts an incredible 250 hours of continuous gameplay on just 1 AA battery; switch to Endurance mode via Logitech G HUB software and extend battery life up to 9 months
- Wireless does not have to mean heavy, G305 lightweight mouse provides high maneuverability coming in at only 3.4 oz thanks to efficient lightweight mechanical design and ultra-efficient battery usage
- The durable, compact design with built-in nano receiver storage makes G305 not just a great portable desktop mouse, but also a great laptop travel companion, use with a gaming laptop and play anywhere
Match the site’s real interaction
Not every dropdown is hover-triggered. If a site opens its menu on click, reproduce that interaction instead of forcing a hover state. For a hover-open menu, keep the pointer on the trigger until the screenshot has been taken. If the intended documentation image should show no hover styling, move the pointer away before capturing.
When capturing visual baselines or comparing screenshots, keep the browser and runtime conditions consistent where possible. Rendering can vary with operating system, browser version, settings, hardware, power source, and headless mode, so differences between runs are not necessarily caused by a website change.
Rank #3
- Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
- Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
- Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
- Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
- Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)
Troubleshoot a missing or incomplete menu
- The menu never opens: Confirm the page uses hover rather than click, and verify that the locator identifies the actual trigger. Try a locator based on the control’s accessible role and name.
- The screenshot is taken too soon: Wait for a menu-specific selector to become visible or for another observable condition. A fixed delay can be useful for a known animation, but it is less dependable than waiting for the expected state.
- The trigger is off screen: Playwright’s locator hover scrolls the target into view; if the page has sticky headers or overlays, check that the trigger is still unobstructed and interactable.
- The menu is clipped: Use a larger viewport, capture a containing element with suitable bounds, or adjust the page layout for the documentation capture. Check for menu content rendered outside the selected element.
- The full-page result loses the menu: Capture the relevant viewport or navigation element instead, then inspect the saved file. Full-page capture does not promise that dynamic UI state will persist throughout the capture.
- Baseline images vary unexpectedly: Keep browser version, operating system, viewport, and runtime mode aligned with the baseline environment.
Or skip the browser setup
ScreenshotNeo can capture a URL through one API request. Its clean-shot steps accept cookie or consent banners like a visitor and remove 60+ known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. It also has an MCP server for AI agents, with tools including take_screenshot, get_page_info, and capture_pdf. The one-call capture below saves a screenshot of the URL; it does not automate a hover interaction, so use the Playwright workflow above when the menu must be opened by hovering.
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 request options. Plans include 1,000 screenshots a month free with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Can Playwright screenshot a hovered element?
Yes. Hover the trigger first, then call screenshot on the relevant element while the hover state is still active.
Rank #4
- Computer mouse for easily navigating a computer interface; click, scroll, and more
- USB-A wired connection; if existing device only supports USB-C, an additional adapter will be required
- High-definition (1000 dpi) optical tracking ensures responsive cursor control for precise tracking and easy text selection
- 3 buttons offer effortless fingertip control
- Plug-and-go ready for instant use
Should I use a viewport or full-page screenshot for a dropdown?
Use a viewport or navigation-element capture when the goal is to show the open dropdown reliably. Inspect a full-page capture because transient hover state may not remain visible throughout it.
Quick Recap
Best Value
- 【Plug and Play for Home/Office/School】The wireless computer mouse features 2.4GHz connectivity, delivering a stable, interference-free connection up to 32ft. Designed for 𝐦𝐞𝐝𝐢𝐮𝐦 𝐭𝐨 𝐥𝐚𝐫𝐠𝐞 𝐬𝐢𝐳𝐞𝐝 𝐡𝐚𝐧𝐝𝐬, it ensures comfortable use all day. Simply plug in the USB-A receiver for instant pairing—no drivers needed. 📌📌 If the mouse isn’t suitable, place the USB receiver in the battery compartment and return both.
- 【3 Levels Adjustable DPI】This travel USB mouse offers 3 adjustable DPI settings (800, 1200, 1600), allowing you to customize sensitivity for precise design work. Effortlessly switch to match your task and elevate your productivity. 📌 Please remove the film at the bottom of the mouse before use.
- 【Effortless Browsing】Equipped with forward and backward buttons, this computer mice streamlines your workflow, making it easy to navigate through web pages and files with a simple click. 📌Side button does not work on Mac.
- 【Visible Indicator Light】 The pc mouse features a visual indicator for DPI levels and low battery alerts. The red light flashes once for 800 DPI, twice for 1200 DPI, and three times for 1600 DPI. When the battery level is below 10%, the light flashes red until the mouse is completely out of power.
- 【Click to Wake】With smart sleep mode, it saves power by standby after 10 inactive minutes, just 2-3 clicks to wake. This efficient design delivers 3x longer battery life than motion-wake mice. Engineered for durability, its buttons and scroll wheel are tested for 10 million clicks, ensuring long-term reliability and consistent performance.
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.




