Anders Lindén
Anders Lindén

Reputation: 7303

ChromeDriver has started to create blank screenshots?

I am using ChromeDriver to create automated browser tests. This stopped working today, taking a look at the screenshots that are saved in the database, they are all blank pixels.

Why?

Version

ChromeDriver 2.29.0

Screenshot

Empty screenshot

Hexdump

Start of hexdump

End of hexdump

Code (c#)

foreach (var testStep in testSteps.ToList())
{
    var testStepRun = new TestStepRun();
    repo.createTestStepRun(testStepRun);

    /* I omit this function in my posting but will include it if needed */
    RunTestStep(testStep);

    try
    {
        testStepRun.ScreenshotPNG = driver.GetScreenshot().AsByteArray;
    }
    catch(UnhandledAlertException)
    {
    }

    repo.SaveChanges();
}

Upvotes: 1

Views: 1946

Answers (2)

Pavel Stryhelski
Pavel Stryhelski

Reputation: 41

It can be related to current ChromeDriver version and Chrome version we use. I`m facing the same issue. I have tried some variants of ChromeDriver/Chrome version to find working one. You can also have a look at the existing issue: https://github.com/SeleniumHQ/selenium/issues/3700

Upvotes: 0

Ruud
Ruud

Reputation: 46

It's related to your Chrome browser. Downgrade to version 58: https://www.slimjet.com/chrome/google-chrome-old-version.php

Upvotes: 3

Related Questions