How to Generate HTML report from Junit Xml report
NickName:user3363830 Ask DateTime:2014-02-28T15:56:28

How to Generate HTML report from Junit Xml report

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

More about “How to Generate HTML report from Junit Xml report” related questions

How to Generate HTML report from Junit Xml report

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-

Show Detail

Generate XML report of JUnit Testcases

How can I generate XML report output of my Maven project? I am trying to view test coverage report in Sonar but its coming as 0.0% , from the documention http://docs.sonarqube.org/display/PLUG/C...

Show Detail

How to generate JUnit style XML report using TestNG?

I'm using TestNG framework for our integration testing. I want to generate JUnit style XML report using TestNG. My project does not use Ant but we use Maven. Can you please tell what is the format of

Show Detail

how can i create a html report for the junit xml report manually?

I have run junit and it shows the results in Junit console, then i do a export of the result, it is saved as some test.xml. now i want to generate a html report out of it how do i do it ? MY projec...

Show Detail

Outputting the cucumber junit report to specific xml file

In my cucumber.yml file I gave following line of code to generate the junit report. The objective is to generate the junit report in file report.xml , however after the execution it is creating the

Show Detail

How to generate test report in XML

I have tests (Unit and Integration) in Go and I need to generate a report in XML (Preferably Junit). Also each test tests a certain functionality. Hence I would like them to be grouped/tagged in re...

Show Detail

How to generate JUnit HTML report in Netbeans 7.1?

How can I generate JUnit HTML report in Netbeans 7.1?

Show Detail

Configuration for Gradle 4.7 to generate the HTML report for JUnit 5 tests

I have an app based as follows: Spring Framework 5.0.4.RELEASE Gradle 4.7 - multimodule project configured through JUnit 5.1.1 The configuration about Gradle with JUnit is in the build.gradle f...

Show Detail

How to generate a cobertura html report from an xml report

I want to generate a cobertura html report from the cobertura xml report. It seems that Jenkins Cobertura plugin can do this but I could not figure out how. I tried the following but it does only

Show Detail

how to generate html report if my Junit is not run by Ant but by JunitCore.run

I worked on a project in which testclasses are run via JunitCore.run(testClasses) not via Ant because I have to run the project even with no ANT framework (so no Testng for the same reason). But I ...

Show Detail