How to create HTML file using Java you could check here How to create HTML file using Java

read what he said In Java, using StringBuilder, we can build HTML String and write it to a html file. This article explains how to write a html file in Java. We create a html file named “testfile.html” with the following content. 

exemple de phrase d'accroche pour site de rencontre Write the following code in the “” class. package testingbar; import*; public class CreateHtmlDocument { public static void main(String[] args) { try { //define a HTML String Builder StringBuilder htmlStringBuilder=new StringBuilder(); //append html header and title htmlStringBuilder.append("<html><head><title>Selenium Test </title></head>"); //append body htmlStringBuilder.append("<body>"); //append table htmlStringBuilder.append("<table border=\"1\" bordercolor=\"#000000\">"); //append row htmlStringBuilder.append("<tr><td><b>TestId</b></td><td><b>TestName</b></td><td><b>TestResult</b></td></tr>"); //append row htmlStringBuilder.append("<tr><td>001</td><td>Login</td><td>Passed</td></tr>"); //append row htmlStringBuilder.append("<tr><td>002</td><td>Logout</td><td>Passed</td></tr>"); //close html file htmlStringBuilder.append("</table></body></html>"); //write html string content to a file WriteToFile(htmlStringBuilder.toString(),"testfile.html"); } catch (IOException e) { e.printStackTrace(); } } public static void WriteToFile(String fileContent, String fileName) throws IOException { String projectPath = System.getProperty("user.dir"); String tempFile = projectPath + File.separator+fileName; File file = new File(tempFile); // if file does exists, then delete and create a new file if (file.exists()) { try { File newFileName = new File(projectPath + File.separator+ "backup_"+fileName); file.renameTo(newFileName); file.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } //write to file with OutputStreamWriter OutputStream outputStream = new FileOutputStream(file.getAbsoluteFile()); Writer writer=new OutputStreamWriter(outputStream); writer.write(fileContent); writer.close(); } }

rencontrer un homme a 30 ans Run the code above, open the html file “testfile.html”. You will see the content below Note: A html file is created under your Project with the above content.