iOS
Appium
java
I have taken screen shots of appium test with following script.
String path;
try {
WebDriver augmentedDriver = new Augmenter().augment(driver);
File source = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
path = "/Users/admin/Desktop/newfolder" + source.getName();
org.apache.commons.io.FileUtils.copyFile(source, new File(path));
}
catch(IOException e) {
path = "Failed to capture screenshot: " + e.getMessage();
}
I want to take them to a folder named with timestamp.
But now I’m getting them to desktop named like this.
How to give path to a folder to save these screenshots during appium test?