appium 截图
代码:
public void ScreenShot(AndroidDrive drives){
//获取screenshot文件
File screenShot = drives.getScreenshotAs(OutputType.FILE);
//文件copy到指定的文件夹
FileUtils.coprfile(screenShot,new File("./dir"+getDatetime()+".jpg");
}
//获取系统时间
public String getDatetime(){
SimpleDateFormat date = new SimpleDateFormat("yyyymmdd hhmmss");
return date.format(new Date());
}