Aparece un error genérico en GDI + para Selenium webdriver. Todavía funcionaba bien ayer, pero de repente me aparece este error.Ocurrió un error genérico en GDI + Selenium webdriver
public string TakeScreenshot(IWebDriver driver, string SnapFolderPath, string TCID, string KeyFunction)
{
try
{
// driver.Manage().Window.Maximize();
ITakesScreenshot ssdriver = driver as ITakesScreenshot;
Screenshot screenshot = ssdriver.GetScreenshot();
string filePath = testReport + "\\" + TCID + "_" + KeyFunction + "_" + GetDateTimeforFilePath() + ".png";
screenshot.SaveAsFile(filePath, ImageFormat.Png);
return filePath;
}
catch (Exception ex)
{
return string.Empty;
}
}
Excepción externa:. {" Se produjo un error genérico en GDI +. "} – Pat
Veo que lo ha resuelto, pero solo como referencia adicional, esto no viene de Selenium, esto viene de la biblioteca de GDI. (El selenio simplemente llama a un código .NET de Microsoft para guardar la captura de pantalla) – Arran