原文:https://www.yuque.com/miyang.meyoung/automation_web/nzu3eh
截图.
1. 打开百度主页
2. 截图
@Test public void screenShot() { driver.get("https://www.baidu.com"); File screenShotFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); try { FileUtils.copyFile(screenShotFile, new File("./test.png")); } catch (IOException e) { e.printStackTrace(); } }
浙公网安备 33010602011771号