/**截图 * @param driver * @param name */ public static void takeScreenShot(WebDriver driver,String name){ File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); try { FileUtils.copyFile(scrFile, new File("c:\"+ name)); } catch (IOException e) { e.printStackTrace(); } }