This documentation relates to QuickBuild 13.0.x
Select here if you are using a different version

Publish JUnit Report

To publish JUnit report, you only need two steps:

  1. Generate JUnit XML report from Ant or Maven or any other build tool.
  2. Add a JUnit report publish step by choosing Publish -> Junit Report in step menu.

Generate JUnit Report

QuickBuild will NOT generate JUnit report automatically, so first make sure the JUnit report is produced by ANT or by any other build tool. The following example shows how to generate JUnit test results with Ant JUnit task and aggregate all the test reports into one by using Ant JUnitReport task (this is not required):

JUnit target in build.xml
<target name="junit" depends="compile.test">
    <mkdir dir="${}" />
    <mkdir dir="${}/test-out" />
    <record name="${}/test-output.txt" append="no" action="start"/>
    <junit printsummary="yes" haltonfailure="false" fork="yes">
        <classpath refid="test.classpath"/>
        <formatter type="xml"/>
        <batchtest fork="yes" todir="${}/test-out">
            <fileset dir="${test.home}">
                <include name="**/*"/>
                <exclude name="**/*"/>
    <junitreport todir="${}">
        <fileset dir="${}/test-out">
            <include name="TEST-*.xml"/>
    <record name="${}/test-output.txt" action="stop"/>

The code snippet will generate the XML reports for each test case, and the reports will be captured to '${}' directory.

About haltonfailure

If 'haltonfailure' in junit task is defined to true, the junit reports are not complete. If you want to generate the full reports, set 'haltonfailure' to false.

Publish JUnit Report

Add Publish JUnit Report step to your build workflow. If you have several report sets, you can add several publish JUnit steps with different report set names. Reference this page for more details.

Supported JUnit-style Report

For those who are willing to output JUnit-style XML report by yourself, below illustrates the format supported in QuickBuild:

Testcase element

<testcase classname="xxx" name="xxx" time="xxx">
    <error type="xxx">
           some error message if any
    <failure type="xxx">
           some failure message if any
    <skipped /> <!-- if this test case is skipped -->

The system-out and system-err are not generated by JUnit, so you can use them to output the message only for this testcase and QuickBuild can display them. classname should also include package name, QuickBuild only parse the classname attribute to generate the package name. The attribute time is the duration of a test case which should be in milliseconds.

All child elements: system-out, system-err, error, failure, skipped are optional. The status of test case depends on one of error, failure or skipped element, if none of them, then the test is passed.

Testsuite element

<testsuite classname="xxx" package="xxx" tests="xxx" time="xxx">
    <testcase ...>
    <ignored-testcase ...>  <!-- test case is ignored -->
    <system-out />
    <system-err />

Here, you may use classname only without package attribute, that is, package name will be parsed from attribute classname="com.pmease.quickbuild.DummyTest if there is no package attribute presented. tests attribute and time attribute are optional, QuickBuild will accumulate all test cases and their duration automatically.

The attribute system-out and system-err are for all test cases in this test suite and will be displayed for all test cases in it.

If you have multiple test suites in one report, then a root element <testsuites> should be used, like below:

    <testsuite ...>
    ... ...
    <testsuite ...>


Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.