I'm trying to make selenium take the information that is in the console for my IDE and to save it as a dynamic file instead of it being overwritten.
This is currently what I use to find the console log which works well.
LogEntries logEntries = driver.manage().logs().get(LogType.BROWSER);
for (LogEntry entry : logEntries) {
System.out.println(new Date(entry.getTimestamp()) + " " + entry.getLevel() + " " + entry.getMessage());
My IDE then saves the output to a file. However, I was wondering if there was some way to just take the information from the console into a new file each time? I've done this with screenshots, but not too sure about the console.