java+Selenium实现截屏的操作?
public void screenShot(String name) throws IOException { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd-HHmmss"); String nowDateTime = sdf.format(new Date()); File s_file = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); Files.copy(s_file, new File("D:\\demo\\" 十name "-" 十 nowDateTime十 ".jpg")); }