In jenkins taken screenshots are blank or invalid like in example here:
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);
}