This is probably a java noob question but here is my scenario:
- using selenium, I captured the html source with getBodyText()
- using java, I want to save the information from getBodyText() into a html file so I can review it later
I currently have getBodyText() stored as a String, here's the code:
String stored_report = selenium.getBodyText();
File f = new File("C:/folder/" + "report" + ".html");
FileWriter writer = new FileWriter(f);
writer.append(stored_report);
System.out.println("Report Created is in Location : " + f.getAbsolutePath())
writer.close();
Do I have to use FileReader? What do I need to do so the saved html file still shows the html format? (currently since it's stored as a string, the page shows up with everything appear on one line)
Thanks in advance!