public void ScrShot(){
try{
//how to capture picture
Thread.sleep(5000);
System.out.println("take screen shot");
File scrFile = driver.getScreenshotAs(OutputType.FILE);
String fileName = UUID.randomUUID().toString();
File targetFile = new File("E:/Appium/logs" + fileName+".jpg");
FileUtils.copyFile(scrFile,targetFile);
System.out.println("done");
}catch(Exception e){
System.out.println("Exception while adding a contact: "+e.getMessage());
}
}
}