'How to create a new Folder under"System.getProperty("user.dir")"based on the page title name using selenium java
My Question is "How to create a new Folder under "System.getProperty("user.dir")" automatically based on the page title name using selenium java". Can anyone please help on the below issue.
The below code is used to saved the screenshots in ScreenCapturesJPEG folder, where the ScreenCapturesJPEG folder is created manually, please find the code and screenshot for reference.
String path=System.getProperty("user.dir")+"/ScreenCapturesJPEG/"+Screenshotname+System.currentTimeMillis()+".jpg";
ImageIO.write(tmp, "jpg",new File(path));
Now I am trying to create the new folder after System.getProperty("user.dir"), automatically it should get the page title name as Folder name and need to create the Folder under user.dir .
For example:
String path=System.getProperty("user.dir")+ New Folder (automatically created under user dir) +Screenshotname+System.currentTimeMillis()+".jpg";
Can anyone please help on this issue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

