Appium 截图

来源:互联网 发布:软件盒子下载 编辑:程序博客网 时间:2024/04/27 14:16

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());

}

0 0
原创粉丝点击