In my script, I need to take screenshots at multiple locations. I want to save all screenshots in the same folder, with a unique name for each file.
There are answers explaining how to append time/date stamps to the file, which I do not need. The script will run every week and will overwrite the previous week's image files.
I'm using Java with Webdriver. Here is what I have:
String screenshots;
screenshots = "C:/eStore/Projects/Screenshots/Catalog/"; //location for images
File screenshots = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(screenshots, new File("screenshots + 01Belts.jpg"));
System.currentTimeMillisgood enough?screenshotsvariable? Is that a typo? I hope so..