I am trying to generate the HTML report from the JUnit Xml report which is generated after the completion of the test execution.
I am using PHP + web driver. I have generated a .xml file using --log-junit .
Then i have written one Target in build.xml file to generate the HTML report for thet xml report.Below is my Target:
<target name="junitHTMLreport" description="Create a report for the rest result">
<echo message="Delete the Junit HTML Directory if exists" />
<delete dir="${JUnitHTMLReports.dir}" />
<echo message="Create the Junit HTML Directory" />
<mkdir dir="${JUnitHTMLReports.dir}"/>
<junitreport todir="${JUnitHTMLReports.dir}">
<fileset dir="${JUnitReports.dir}">
<include name="*.xml"/>
</fileset>
<report format="frames" todir="${JUnitHTMLReports.dir}"/>
</junitreport>
</target>
But my problem is that when i hit my target using ant it generates blank HTML file.
I found that when i delete the root element and from my xml and then save that xml and then hit the target using ant. it generates a valid html file.
Do we have any solution to delete the root element at run time so that my ant target pick that xml and generate the HTML run time.
If we can have other other solution to accomplish this. please let me know.
Any help will be appreciated. Thanks in Advance.
Copyright Notice:Content Author:「user3363830」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22089388/how-to-generate-html-report-from-junit-xml-report