1. Home
  2. API & Integrations
  3. TestNG – /testCase/import/XML

TestNG – /testCase/import/XML

TestNG is a popular testing framework for Java applications, known for its flexibility and extensive features. By integrating XML TestNG with Vansah, you can harness the full potential of TestNG while leveraging the comprehensive test management capabilities of Vansah.

This integration eliminates the need for manual test case management and provides a centralized platform for your testing activities.

POST /testCase/import/XML

Imports a XML TestNG file from from your TestNG framework
Request

BODY PARAMETERS JSON format

testFormat
 - TestNG 
Required: Valid type for testing framework and support TestNG

testPaths
Required: Valid XML file generated by your TestNG framework

Purpose of this API Endpoint is to send a TestNG Report Test File (*.xml) from your Automation project to Vansah for Jira.

These test report files produced by your TestNG frameworks will contain test case results (data) that are required to be consumed by the new API and processed by Vansah for Jira.

Sample XML file for TestNG

<?xml version="1.0" encoding="UTF-8"?>
<testng-results ignored="0" total="2" passed="2" failed="0" skipped="0">
  <reporter-output>
  </reporter-output>
  <suite started-at="2023-02-15T01:15:52 AEDT" name="DemoTest" finished-at="2023-02-15T01:15:52 AEDT" duration-ms="34">
    <groups>
    </groups>
    <test started-at="2023-02-15T01:15:52 AEDT" name="Command line test" finished-at="2023-02-15T01:15:52 AEDT" duration-ms="34">
      <class name="DemoTest">
        <test-method signature="Addition_Test()[pri:0, instance:DemoTest@1283bb96, attributes: &lt;name: Case Key, value:[DOT-C1]&gt;, &lt;name: Tested Issue, value:[DOT-1]&gt;, &lt;name: Tested Sprint, value:[DOT Sprint 1]&gt;, &lt;name: Tested Environment, value:[SYS]&gt;]" started-at="2023-02-15T01:15:52 AEDT" name="Addition_Test" finished-at="2023-02-15T01:15:52 AEDT" duration-ms="4" status="PASS">
          <reporter-output>
          </reporter-output>
          <custom-attributes>
            <custom-attribute>
              <name value="Case Key">
              </name>
              <value>
                <![CDATA[[DOT-C1]]]>
              </value>
            </custom-attribute>
            <custom-attribute>
              <name value="Tested Issue">
              </name>
              <value>
                <![CDATA[[DOT-1]]]>
              </value>
            </custom-attribute>
            <custom-attribute>
              <name value="Tested Sprint">
              </name>
              <value>
                <![CDATA[[DOT Sprint 1]]]>
              </value>
            </custom-attribute>
            <custom-attribute>
              <name value="Tested Environment">
              </name>
              <value>
                <![CDATA[[SYS]]]>
              </value>
            </custom-attribute>
          </custom-attributes>
        </test-method> <!-- Addition_Test -->
        <test-method signature="Subtraction_Test()[pri:0, instance:DemoTest@1283bb96, attributes: &lt;name: Case Key, value:[DOT-C1]&gt;, &lt;name: Tested Issue, value:[DOT-1]&gt;, &lt;name: Tested Sprint, value:[DOT Sprint 1]&gt;, &lt;name: Tested Environment, value:[SYS]&gt;]" started-at="2023-02-15T01:15:52 AEDT" name="Subtraction_Test" finished-at="2023-02-15T01:15:52 AEDT" duration-ms="0" status="PASS">
          <reporter-output>
          </reporter-output>
          <custom-attributes>
            <custom-attribute>
              <name value="Case Key">
              </name>
              <value>
                <![CDATA[[DOT-C1]]]>
              </value>
            </custom-attribute>
            <custom-attribute>
              <name value="Tested Issue">
              </name>
              <value>
                <![CDATA[[DOT-1]]]>
              </value>
            </custom-attribute>
            <custom-attribute>
              <name value="Tested Sprint">
              </name>
              <value>
                <![CDATA[[DOT Sprint 1]]]>
              </value>
            </custom-attribute>
            <custom-attribute>
              <name value="Tested Environment">
              </name>
              <value>
                <![CDATA[[SYS]]]>
              </value>
            </custom-attribute>
          </custom-attributes>
        </test-method> <!-- Subtraction_Test -->
      </class> <!-- DemoTest -->
    </test> <!-- Command line test -->
  </suite> <!-- DemoTest -->
</testng-results>

Related Articles