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

Cypress Screenshot Command Options Explained

A practical guide to Cypress cy.screenshot(): capture modes, documented defaults, element captures, masking, saved-file behavior, and failure screenshots.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

cy.screenshot() saves an image of the application under test—or, when you capture a yielded DOM element, just that element. Its most important option is capture: choose viewport for the visible app area, fullPage for a scroll-and-stitch image of the page, or runner to include the browser viewport and Cypress Command Log. Screenshots are saved under Cypress’s configured screenshots folder, which defaults to cypress/screenshots.

Take a page or element screenshot

Call cy.screenshot() directly for the application, or chain it from a command that yields one DOM element to capture that element. Pass an optional filename and options object:

// Capture the application using Cypress's default capture mode
cy.screenshot();

// Choose a filename and capture the current application viewport
cy.screenshot('checkout-viewport', { capture: 'viewport' });

// Capture the DOM element yielded by get()
cy.get('[data-cy=receipt]').screenshot('receipt');

The command yields its original subject. Cypress cautions that chaining commands that rely on that subject after the screenshot is unsafe. Capture is asynchronous, so the displayed application state can change between issuing the command and the resulting image.

Choose a capture mode

capture value What appears Best use
viewport The application in the current browser viewport. Record exactly the visible area without scrolling the page.
fullPage (documented default) The application page, captured by scrolling and stitching images. Include content below the fold. Fixed or sticky elements can appear more than once in the stitched result.
runner The browser viewport together with the Cypress Command Log. Keep runner context with a debugging artifact. The blackout option does not apply to runner captures.

capture is ignored when the command is capturing a DOM element. Cypress also coerces failure screenshots to runner; do not assume a failure image will honor an application-only capture choice.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#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

Options and documented defaults

These are the options documented for cy.screenshot(). Scope matters: padding is for element captures, while blackout does not mask runner captures.

Option Default Effect and practical note
log true Shows the screenshot command in the Cypress Command Log.
blackout [] Array of selectors for elements to black out in applicable captures. It does not apply to runner captures.
capture 'fullPage' Selects viewport, fullPage or runner; ignored for element captures. Failure screenshots are coerced to runner.
clip null Crops the final image to pixel coordinates and dimensions, for example { x: 0, y: 0, width: 100, height: 100 }.
disableTimersAndAnimations true Stops JavaScript timers and CSS animations during capture to reduce visual changes. Set it to false to let them continue.
padding null Adds space around an element screenshot. Accepts one number or up to four numbers in CSS shorthand form; ignored for other screenshot types.
scale false When enabled, scales the application to fit the browser viewport. Cypress coerces it to true for runner captures.
timeout responseTimeout Maximum time to wait for the screenshot command to resolve.
overwrite false When enabled, overwrites a duplicate filename instead of creating a numbered duplicate.
onBeforeScreenshot null Callback before a non-failure capture. Receives the element for an element screenshot, otherwise the document.
onAfterScreenshot null Callback after a non-failure capture. Receives the captured element or document and screenshot properties, including saved path and dimensions.

For repeated behavior across screenshots, Cypress also documents defaults that can set shared screenshot behavior, including capture mode, scaling, timer and animation handling, failure screenshots, blackout selectors, overwrite behavior and callbacks. See the Cypress.Screenshot API.

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

Crop, pad, and mask deliberately

Crop the final image with clip

Use clip when you need a rectangular region expressed in pixels. For example, { x: 0, y: 0, width: 100, height: 100 } crops to a 100-by-100-pixel region at the image origin.

Add space around an element with padding

Use padding with an element screenshot when the element’s bounds are too tight. It accepts a single number or up to four numbers using CSS shorthand. It is ignored for page and runner captures.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
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.

Black out selected content with blackout

Provide selectors for content to cover in applicable screenshots. Verify the capture mode: this option does not apply to runner captures. Cypress Cloud has separate controls for limiting screenshot and replay data; see its data controls documentation. Do not treat a local screenshot mask as a guarantee that all captured or stored data is protected.

Make captures more repeatable

By default, Cypress disables timers and CSS animations during capture. This can reduce movement, but the screenshot is still asynchronous and is not an atomic snapshot of the exact instant the command was issued. If a clock, spinner, or other changing element makes the result inconsistent, use onBeforeScreenshot and onAfterScreenshot to hide and restore it around a non-failure capture. The callbacks receive the document or target element, and the after callback also receives screenshot metadata.

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

For full-page screenshots, account for the scroll-and-stitch process: fixed headers, sticky controls, or other viewport-pinned elements may repeat. If that is undesirable, use a viewport capture or adjust the page state before capture.

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

Set filenames and find the saved image

Without a custom filename, Cypress names the image using the spec and test. A custom filename replaces that suite-and-test naming. Files are saved beneath the configured screenshots folder and spec-relative directory; the default folder is cypress/screenshots. Duplicate filenames normally get a numeric suffix. Set overwrite: true when replacing the existing file is intentional. Failure screenshots append (failed) to the default test name.

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

The screenshots folder is configurable. Cypress takes failure screenshots automatically during cypress run by default, but not automatically on failure in cypress open. To turn off run failure screenshots, set screenshotOnRunFailure: false in configuration or screenshot defaults. See the screenshots and videos guide and configuration reference.

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.

Troubleshoot common screenshot surprises

  • The image contains more than the visible screen: fullPage is the documented default. Set capture: 'viewport' when you want only the current viewport.
  • A sticky header appears multiple times: full-page capture scrolls and stitches. Try a viewport screenshot or change the page state before capture.
  • Blackout selectors did not mask content: check that the capture is not runner, where blackout does not apply.
  • The result differs from the UI at the command line: capture is asynchronous. Cypress disables timers and animations by default, but other application state may still change; stabilize or hide the relevant element with callbacks.
  • A screenshot is missing after a failed test: automatic failure screenshots apply to cypress run, not cypress open, and can be disabled with screenshotOnRunFailure: false.
  • A previous file was not replaced: duplicate names receive a numeric suffix by default. Use overwrite: true only if replacing the old artifact is intended.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server, not a replacement for Cypress’s in-test screenshot command. For a standalone URL capture, one GET request returns an image or PDF. The following cURL example saves a WebP screenshot of Stripe; replace the target URL as needed. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers indicate the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

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

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.

Official Cypress references

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. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
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.