获取设备屏幕截图时出现故障异常
我的代码如下:
//open the page
driver.get("http://wikipedia.com");
//take another screenshot
try {
File screenshot = new File("screenshot1.png");
File tmpScreenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
}
catch(IOException e){
System.out.println("Failed to take screenshot."+e.getMessage());
}
//quit
driver.quit();
}
任何机构都可以帮我解决这个问题吗?