October 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 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 desk6 min

Cypress Screenshots Blank in Headless Chrome: How to Diagnose and Fix Them

A Cypress screenshot can be missing, capture empty page content, or be misrepresented by a CI artifact preview. Use this diagnostic sequence to find the cause.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

First find out which part is blank: the screenshot file may not exist, the page may have rendered empty, or the CI artifact preview may be misleading. Check the saved file and artifact path, then reproduce the same test in headed Chrome before changing viewport settings. Cypress saves screenshots to cypress/screenshots by default and captures failed-run screenshots unless that behavior is disabled.

Identify what “blank” means

Separate these three cases before changing browser settings:

As an Amazon Associate I earn from qualifying purchases.

  • No screenshot file: Cypress may not have captured one, the configured folder may differ from the path your CI workflow collects, or the file may have been cleared before it was uploaded.
  • A file exists but its page is empty: investigate application rendering, test timing, browser state, and differences between headed and headless runs.
  • The local file looks correct but the CI preview is blank: inspect the uploaded artifact itself and confirm the workflow exports the correct file after the run.

Cypress’s default screenshot folder is cypress/screenshots. Its screenshotOnRunFailure setting defaults to true for cypress run; verify your project configuration rather than assuming those defaults remain in effect. See Cypress screenshot and video capture documentation and the cy.screenshot() API reference.

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

Check whether Cypress created and retained the file

  1. Open the project’s configured screenshotsFolder. If you have not changed it, look in cypress/screenshots.
  2. Check that screenshotOnRunFailure is enabled if you expect automatic captures when a test fails. A manually invoked cy.screenshot() is a separate capture path.
  3. Check the CI artifact step’s input path and timing. It must collect the configured screenshot directory after Cypress finishes.
  4. Check trashAssetsBeforeRuns. It defaults to true and clears configured downloads, screenshots, and videos folders before a run, so a workflow must not rely on a screenshot left by an earlier run.
  5. If the test is passing but you expect a failure screenshot, confirm the test actually fails in the run whose artifacts you are inspecting.

Cypress can make failed-run screenshots available through Cypress Cloud or through a CI provider’s artifact mechanism; the exact export and viewing steps depend on your CI setup. The relevant settings are documented in Cypress configuration.

Reproduce the problem in headed Chrome

When the file exists but captures empty content—or you suspect a headless-only difference—run the same test visibly:

npx cypress run --headed --no-exit --browser chrome

Cypress launches browsers headlessly by default when you run cypress run from the CLI. In the headed reproduction, watch the page and inspect the Cypress command log and final application state. Compare what you see with the headless screenshot and, if enabled, the run video. If both modes show an empty page, the issue is more likely in the test or application state than in headless capture itself. If only headless is affected, compare browser version and environment next.

Rank #2
Free Fling File Transfer Software for Windows [PC Download]
  • Intuitive interface of a conventional FTP client
  • Easy and Reliable FTP Site Maintenance.
  • FTP Automation and Synchronization

Videos are disabled by default (video: false). You can enable them in Cypress configuration to inspect what happened over the course of a failing run; consult the screenshot and video guide for capture behavior.

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

Investigate browser state, policy, and version differences

Did the test open a new tab?

A specific Chromium case can produce a screenshot problem when the Cypress tab’s renderer is paused after a test opens another tab, often through a link with target="_blank". Cypress documents that Chromium will not capture screenshots while the Cypress tab’s renderer is paused and that it attempts to activate the tab during capture. Check this avenue when the failure follows a new-tab action; it is not a general explanation for every blank screenshot. See Cypress’s screenshot command documentation.

Could browser extensions or enterprise policy interfere?

Check whether extensions or Chrome enterprise/group policies differ between your local machine and CI. Cypress notes that extension restrictions can cause problems and recommends considering Chrome for Testing when enterprise policies interfere. For version-sensitive failures, record the Chrome version in both environments: Chrome is evergreen, and browser updates can break automated tests. Cypress’s configuration guidance covers these troubleshooting considerations.

Compare the environments before changing the test

Run the same test locally and in CI, and compare the browser, operating system, fonts, display scaling, viewport, and relevant policies. Those differences can affect rendering and screenshot output. For repeatable visual comparisons, use the same environment and fixed viewport, and pin the browser version where practical. Cypress discusses high-resolution capture and the impact of environment consistency in its high-resolution screenshots and videos guide.

Change viewport or device scale only for a size or scaling problem

Cypress documents a headless viewport of 1280 × 720 and a device pixel ratio (DPR) of 1. These affect screenshot and video dimensions; they are not a reliable general fix for a page whose content is entirely blank. If the page renders but the screenshot has the wrong size or scale, Cypress shows how to adjust headless Chrome launch settings through before:browser:launch. Use its browser launching documentation for the current configuration pattern, then confirm the resulting dimensions in the saved image.

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

Likewise, cy.screenshot() is asynchronous and takes around 100 ms. If the application changes state around capture time, ensure the test waits for the intended state before taking the screenshot. Cypress also notes that the Command Log renders asynchronously, so a screenshot may not include an error shown there. See cy.screenshot().

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

Troubleshoot by symptom

Symptom Likely avenue to check What to do
No PNG appears Automatic failure capture is disabled, the folder differs, or the artifact step collects the wrong path. Check screenshotOnRunFailure, screenshotsFolder, and the CI upload path and timing.
Old screenshots disappear after a run trashAssetsBeforeRuns is enabled, as it is by default. Collect artifacts from the current run after Cypress completes; do not rely on files from a previous run.
The screenshot file exists but page content is empty in headless mode The application may not have reached the intended state, or browser state/version/policy differs. Run the same test headed, inspect the final page, and compare local versus CI browser and environment.
Failure starts after opening a new tab Chromium’s Cypress-tab renderer may be paused. Investigate tab activation and the documented Chromium screenshot limitation.
Content is present but dimensions or scale are wrong Headless viewport or DPR differs from what the comparison expects. Check the documented 1280 × 720, DPR 1 defaults and adjust browser launch settings only if needed.
Only the CI artifact preview appears blank The wrong file or path may have been uploaded, or the preview may not represent the image correctly. Download and open the artifact itself; verify the configured screenshot directory and upload step.

Or skip the browser setup

If your goal is to capture a website rather than debug Cypress’s browser session, ScreenshotNeo provides a screenshot API and MCP server. Its capture can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before taking the shot; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. AI agents can use its MCP server tools to take screenshots, get page information, or capture PDFs.

One GET request returns an image or PDF. For example, the cURL request below saves a WebP screenshot; see the ScreenshotNeo API documentation for parameters and response details.

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

ScreenshotNeo includes 1,000 screenshots a month on its free plan with no card required; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo’s free plan.

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

Frequently Asked Questions

Does a blank screenshot mean Cypress did not capture one?

Not necessarily. Check whether the image file exists; an empty page image and a missing file point to different causes.

Should I change the viewport to fix a completely white page?

Not as a first step. Viewport and DPR settings affect dimensions and scale; reproduce headed and inspect rendering before changing them.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

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.