我得到一般性錯誤發生在GDI +硒webdriver.It還在昨天工作正常,但突然我得到這個錯誤。一般性錯誤在GDI +硒的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;
}
}
外部異常的image.If的文件夾:{」在GDI +中出現了一個通用錯誤。「} – Pat
我看到你已經解決了它,但僅僅爲了進一步參考,這不是來自Selenium,而是來自GDI庫。 (Selenium只是從Microsoft調用一些.NET代碼來保存屏幕截圖) – Arran