Cypress: Blank video recording

Created on 13 Feb 2018  路  30Comments  路  Source: cypress-io/cypress

Current behavior:

Recorded video is returned blank.

Desired behavior:

Video to record normally.

How to reproduce:

When I run cypress I get both a video and snapshot returned to me but they are both blank. When I run cypress in headed mode I get a correct snapshot back but no video (since video recording isn't supported in headed mode).

Additional Info (images, stack traces, etc)

In headless mode:
image
image
In headed mode:
image

  • Operating System: Windows 10
  • Cypress Version: 1.4.2
  • Browser Version: Electron 53.0.2785.143
windows video 馃摴 bug

Most helpful comment

I am facing the same issue. In the headless mode I get the video but it is blank.
Below are the details of my configuration.
Cypress version: 2.1.0
OS: Win7 Professional (x64)

All 30 comments

I am facing the same issue. In the headless mode I get the video but it is blank.
Below are the details of my configuration.
Cypress version: 2.1.0
OS: Win7 Professional (x64)

@rgavinc, I cannot reproduce this bug with 1.4.2
nor @fdaryaee, can I reproduce with 2.1.0
Can either of you provide a little more information about your tests?

  • Do you experience this behavior when running all of your test suites or projects?
  • Can you provide the steps and/or commands you issued to run your tests?
  • Are either of you behind a corporate proxy?

I am using following command to run the tests in a headless mode. I see this issue in both cases i.e. if I run a single test or all the tests in a suite.

To run all the tests I use following command

npx cypress run --env configFile=test

To run a single test I use following command

npx cypress run --env configFile=test --spec cypress\integration\matchmaker_spec.js

In both the cases, video is recorded but its bank (See screenshots attached)
Size of Video file for all tests is 203 KB (2.41 min video)
Size of Video file for single test is 2.4 KB ( less than a sec video)

Also, we are not behind a corporate proxy.

all_tests

single_test

Unfortunately, we will have to have a reproducible repo that we can run to reproduce this. We have tried running some of our example repos - also in Windows, but have been unable to reproduce it.

Can someone provide a repo/code to reproduce?

The repo is private and something which I cannot share unfortunately. I can help with any other information that can help you reproduce this. Please let me know what all you need. Thanks!

@ValerieThoma & @jennifer-shehane Can replicate this problem with my project, and yes we are behind a company proxy where https://api.cypress.io/is blocked.

In headed mode, screenshots work per expected, they issue arises in headless mode where they are blank.

A simple test like this will produce a blank screenshot in headless:

describe('Sanity', function() {
    it('True is true', function() {
      cy.visit('https://news.ycombinator.com/'); // or any url
      cy.screenshot('HN')
      expect(true).to.equal(true)
    })
  })
  • Operating System: Windows 7
  • Cypress Version: 2.0.3
  • Electron Version: 59

BTW, Thank you for a great product and support!

Can you try to set HTTP_PROXY and/or HTTPS_PROXY to your corporate proxy as environment variables? I detailed some of this fix here: https://github.com/cypress-io/cypress/issues/1469#issue-305961859

But for Windows, it should be something like

set HTTP_PROXY "http://my-corporate-proxy-address"

I'm having the same issue. I tried run the project I'm working on Ubuntu VM and it worked, I got video and images, but on Windows 10 the video is blank and the images are black.

Perhaps a Xvfb library is missing for Windows or something like that?

I have the same issue

I'm seeing blank videos as well. This is with:

  • Cypress 3.0.1
  • Electron 59 (headless)
  • Windows 8.1

Screenshots are also blank.

Xvfb is not used or needed in Windows. It's linux only.

Can you all try Chrome instead of Electron to see if the screenshots aren't blank?

Screenshots are working when I use -b chrome, will check this with video capture next.

Edit: Of course, I forgot that video capture is not available with Chrome.

Can you update to 3.0.2 and see if this issue is resolved?

We updated ffmpeg to 4.x.x there and added many more debugging logs.

Also please be sure that you use DEBUG=cypress:* cypress run when running so that we can get the debug logs to understand what is happening.

For me is working now with version 3.0.1

I am facing the same issue with video recording. In the headless mode the video is blank.
Cypress version: 3.0.1 (btw, can't upgrade to 3.0.2 - https://github.com/cypress-io/cypress/issues/2097)
OS: Win7 Professional (x64)

We had the same problem, but it went away after two changes; we went from running the TFS-agent as an app to running it as a service and we changed the user. So it might a permission-issue. It might not be related to both of the changes, but this might give you something to try.

Hi, I encountered this issue yesterday and managed to resolve it.
What I did was install cypress as an administrator. (I was running it on my local machine as non admin since I didn't have any issues with it before).

Once I installed node, angular, & cypress using an admin profile and ran it using the same admin profile it was able to render both videos and screenshots in headless mode.

Hopefully this helps debugging!

Version: Cypress 3.1
System: Windows 7

I have the same problem
Version: Cypress 3.1.3
System: Windows server 2012

Hi, I encountered this issue yesterday and managed to resolve it.
What I did was install cypress as an administrator. (I was running it on my local machine as non admin since I didn't have any issues with it before).

Once I installed node, angular, & cypress using an admin profile and ran it using the same admin profile it was able to render both videos and screenshots in headless mode.

Hopefully this helps debugging!

Version: Cypress 3.1
System: Windows 7

@kvillega how to run or install cypress in admin mode?

This is my first time using cypress and encountering the same issue.
cypress run --spec "cypress/integration/sample_spec.js"

The content is to go to google.com and just search any keyword then click on images.
The code includes cy.screenshot("Step n")

When running via cypress desktop the snapshots/screenshots are good! (but no video)
On cypress run the screenshots are all black while video is just white but have duration.

I have the same issue. Test running on TeamCity build agent. Only-b chrome solve this issue

Can you try to add this code to the pluginsFile at cypress/plugins/index.js? Let us know if it changes anything.

Try --disable-d3d11 and --disable-gpu flags independently also. Some combination of this may help things.

module.exports = (on, config) => {
  on('before:browser:launch', (browser = {}, args) => {
    if (browser.name === 'electron') {
      args['disable-gpu']
      args['disable-d3d11']

      return args
    }
  })
}

No, nothing has changed:( Video and screenshots is empty
And one more. when I run cypress with -b chrome option on build agent from TeamCity UI it's say that "A video will not be recorded when using this browser." , but when I run it from build agent from cmd video record is fine

Hi team,

Is there any update to this issue? I am running into the exact same problem as @rgavinc where screenshots and video in headless electron returns blank but screenshot works in headed electron.

  • I am experiencing this on all test suites and projects. Even the simplest of test - opening a page and taking a screenshot) would result in the same error.
  • Commands issued in the test are cy.visit('www.google.com') and cy.screenshot()

I am behind a corporate proxy and have tried the following to no avail:

  1. Setting HTTP_PROXY and HTTPS_PROXY.
  2. Disabling the disable-d3d11 and disable-gpu as per recommended by @jennifer-shehane

My logs from DEBUG=cypress:* are uploaded here.

*Edited to include versions used:
Cypress 3.1.4
Electron 59 (headless)
Windows 7 - 64 Bit

Is this issue also resolved with PR #3531?

@glitchperfect Oh, I really hope so! Can anyone run Cypress against the develop branch that is experiencing this issue to verify if this fixes the issue?

@flotwig Thoughts on this issue being resolved for proxy support? Would you be able to replicate this issue and verify?

@jennifer-shehane Is this a network-related issue? I tried running Cypress with api.cypress.io blocked, but it still successfully takes screenshots and videos in run mode on the latest develop branch (even with no Internet access at all).

This comment says they are experiencing the issue but are not behind a corporate proxy, so it might not be related.

@flotwig We've never been able to reproduce this, so we're unsure of the core issue. I just know some people mentioned proxy, so was hoping this may have been the issue.

Just to close this old issue. The bug has been resolved for me.

Yes, I am considering this to be resolved since there have not been really any mentions of this in nearly a year.

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

Was this page helpful?
4 / 5 - 1 ratings