有一些问题。我正在使用带有 C# 的 webdriver。这是代码
ITakesScreenshot screenshotDriver = driver as ITakesScreenshot;
Screenshot screenshot = screenshotDriver.GetScreenshot();
screenshot.SaveAsFile("c:/Image_23.png", System.Drawing.Imaging.ImageFormat.Jpeg);
然后它为该行抛出 System.NullReferenceException:
Screenshot screenshot = screenshotDriver.GetScreenshot();
我错在哪里?