5

In jenkins taken screenshots are blank or invalid like in example here:

Jenkins screenshot

Maybe someone knows what kind problem could be with it? Locally everything works fine

WebDriver.ChromeDriver.win32 version - 2.30.0

Selenium.WebDriver version - 3.4.0

Code:

 try
        {
            var screenshotFileName = _filePath + ".png";
            ((ITakesScreenshot) Extensions.Driver).GetScreenshot().SaveAsFile(screenshotFileName, ScreenshotImageFormat.Png);
            Log.Error("Screenshot has been taken: " + screenshotFileName);
        }
        catch (Exception ex)
        {
            Log.Warning("TakeScreenshot failed: " + ex.Message);
        }

5 Answers 5

2

It seems that this issue happened before. Check this: https://bugs.chromium.org/p/chromedriver/issues/detail?id=476

It's probably bug in new chromedriver 2.30. I had the same issue and the workaround is to connect to VM by Remote Desktop Connection. Problem only occurs when you use selenium remotely and noone is connected to node via RDC.

Hopefully next chromedriver version will fix this.

1
  • It was working with 2.28 for a while and now stopped working
    – krapstuke
    Jun 20, 2017 at 10:27
3

This seems to be an issue with Chrome 59 itself:

https://bugs.chromium.org/p/chromedriver/issues/detail?id=1844&can=2&start=0&num=100&q=screenshots&colspec=ID%20Status%20Pri%20Owner%20Summary&groupby=&sort=-id

I tried reverting to Chromedriver 2.29, but got the same results (blank screenshot).

1

Jenkins - RobotFramework - Selenium2Library: generated blank screenshots , after downgrade Chrome from v.59 to v.58 problem solved and screenshots are generated as expected. Old versions of Chrome : http://www.slimjet.com/chrome/google-chrome-old-version.php

0

unset TZ before running headless chrome solved the issue with blank screenshots here.

When TZ was set (correctly) to /usr/share/zoneinfo/Europe/Oslo, there were errors in the js console in chrome.

0

In my case the reason was that i run selenium in headless mode so i've disabled "--headless" argument and now it works

options = webdriver.ChromeOptions()
### disable this
#options.add_argument('--headless')

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .