我得到泛型错误发生在GDI为selenium webdriver.At昨天工作正常,但突然我得到这个错误.
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; } }