ChromeDriver has started to create blank screenshots?

送分小仙女□ 提交于 2019-12-11 06:44:45

问题


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

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();
}

回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/44879525/chromedriver-has-started-to-create-blank-screenshots

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!