Class ReportGenerator


  • public class ReportGenerator
    extends Object
    This class generates HTML report based on testNG result XML file.
    • Constructor Detail

      • ReportGenerator

        public ReportGenerator​(String dataDir,
                               String templateDir,
                               String outputDir)
        Creates an instance of ReportGenerator object.
        Parameters:
        dataDir - Directory where code>testNG result XML resides.
        templateDir - Directory where HTML templates reside.
        outputDir - Directory to place the HTML reports.
    • Method Detail

      • writeToFile

        public static void writeToFile​(String content,
                                       String fileName)
                                throws IOException
        Writes content to a file.
        Parameters:
        content - Content to be written.
        fileName - Name of file of which content is written to.
        Throws:
        IOException - if content cannot be written.
      • getFileContent

        public static String getFileContent​(String fileName)
                                     throws IOException
        Returns content of a file.
        Parameters:
        fileName - Name of the file.
        Returns:
        Content of a file.
        Throws:
        IOException - if connect cannot be read.
      • main

        public static void main​(String[] args)