I am currently logging test execution results in to a textfile(An existing one.) How do I create a textfile with a timestamp and save it in a windows directory? The code I am using currently is
File outputResultFile = new File(CompleteFileNameForNotepad);
PrintWriter outputFile = new PrintWriter(new FileWriter(outputResultFile));
String str = "text to write in to the file";
outputFile.println(str);
outputFile.close();
Thanks for your help.
Note: what you call a notepad is more commonly called a “file”.