Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

https://cucumber.io/docs/cucumber/reporting/#built-in-reporter-plugins

Table of Contents
maxLevel2

...

Xray JSON format

/rest/raven/1.0/import/execution

Xray JSON format multipart/rest/raven/1.0/import/execution/multipart
Cucumber JSON output format

/rest/raven/1.0/import/execution/cucumber

Cucumber JSON output format multipart

/rest/raven/1.0/import/execution/cucumber/multipart

Behave JSON output format

/rest/raven/1.0/import/execution/behave

Behave JSON output format multipart

/rest/raven/1.0/import/execution/behave/multipart

JUnit XML output format/rest/raven/1.0/import/execution/junit
JUnit XML output format multipart/rest/raven/1.0/import/execution/junit/multipart
TestNG XML output format/rest/raven/1.0/import/execution/testng
TestNG XML output format multipart/rest/raven/1.0/import/execution/testng/multipart
NUnit XML output format/rest/raven/1.0/import/execution/nunit
NUnit XML output format multipart/rest/raven/1.0/import/execution/nunit/multipart
Robot Framework XML output format/rest/raven/1.0/import/execution/robot
Robot Framework XML output format multipart/rest/raven/1.0/import/execution/robot/multipart
Compressed .zip file (e.g., Calabash execution results)

/rest/raven/1.0/import/execution/bundle

...

Xray provides another endpoint if you want to create new Test Executions and have control over newly-created Test Execution and Test fields. It allows you to send one XML file (the JUnit report) and two JSON files similar to the one Jira uses to create new issues. For more information about that second JSON format, check the Jira documentation here.

As of the creation of Test issues, some field values in the JSON file for Test Issue creation will follow some rules:

  • Issue Type: Overridden by the Test issue type;
  • Summary: Overridden by the internally generated summary;
  • Parent: This field is ignored;
  • Project: If the there is not a Test issue with the same Generic Test Definition, then it will be created in the provided project;
  • Generic Test Definition: Not allowed to provide a value for this field.

...

Xray provides another endpoint if you want to create new Test Executions and have control over newly-created Test Execution and Test Execution fields. It allows you to send one XML file (the TestNG report) and a two JSON files similar to the one Jira uses to create new issues. For more information about that second JSON format, check the Jira documentation here.

As of the creation of Test issues, some field values in the JSON file will follow some rules:

  • Issue Type: Overridden by the Test issue type;
  • Summary: Overridden by the internally generated summary;
  • Parent: This field is ignored;
  • Project: If the there is not a Test issue with the same Generic Test Definition, then it will be created in the provided project;
  • Generic Test Definition: Not allowed to provide a value for this field.


Expand
titlePOST /rest/raven/1.0/import/execution/testng/multipart
Panel
borderColor#ccc
borderStylesolid

Import the execution results created with the NUnit XML output formatter. For more information please check the documentation about TestNG integration.

Note: Currently, if you specify the Test Plan custom field, the Tests of the Test Execution will not be added automatically to the Test Plan.

Request

Example

Code Block
languagexml
titleTestNG XML Report
<?xml version="1.0" encoding="UTF-8"?>
<testng-results skipped="0" failed="2" ignored="0" total="8" passed="6">
  <reporter-output>
  </reporter-output>
  <suite name="TestAll" duration-ms="33" started-at="2018-03-06T11:53:00Z" finished-at="2018-03-06T11:53:00Z">
    <groups>
    </groups>
    <test name="calculator" duration-ms="33" started-at="2018-03-06T11:53:00Z" finished-at="2018-03-06T11:53:00Z">
      <class name="com.xpand.java.CalcTest">
        <test-method status="PASS" signature="setUp()[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="setUp" is-config="true" duration-ms="9" started-at="2018-03-06T11:53:00Z" finished-at="2018-03-06T11:53:00Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- setUp -->
        <test-method status="PASS" signature="CanAddNumbers()[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="CanAddNumbers" duration-ms="2" started-at="2018-03-06T11:53:00Z" finished-at="2018-03-06T11:53:00Z">
          <reporter-output>
          </reporter-output>
          <attributes>
            <attribute name="test">
              <![CDATA[]]>
            </attribute> <!-- test -->
            <attribute name="requirement">
              <![CDATA[CALC-1235]]>
            </attribute> <!-- requirement -->
            <attribute name="labels">
              <![CDATA[core]]>
            </attribute> <!-- labels -->
          </attributes>
        </test-method> <!-- CanAddNumbers -->
        <test-method status="PASS" signature="CanAddNumbersFromGivenData(int, int, int)[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="CanAddNumbersFromGivenData" duration-ms="0" started-at="2018-03-06T11:53:00Z" data-provider="ValidDataProvider" finished-at="2018-03-06T11:53:00Z">
          <params>
            <param index="0">
              <value>
                <![CDATA[1]]>
              </value>
            </param>
            <param index="1">
              <value>
                <![CDATA[2]]>
              </value>
            </param>
            <param index="2">
              <value>
                <![CDATA[3]]>
              </value>
            </param>
          </params>
          <reporter-output>
          </reporter-output>
          <attributes>
            <attribute name="test">
              <![CDATA[]]>
            </attribute> <!-- test -->
            <attribute name="requirement">
              <![CDATA[CALC-1235]]>
            </attribute> <!-- requirement -->
            <attribute name="labels">
              <![CDATA[core]]>
            </attribute> <!-- labels -->
          </attributes>
        </test-method> <!-- CanAddNumbersFromGivenData -->
        <test-method status="FAIL" signature="CanAddNumbersFromGivenData(int, int, int)[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="CanAddNumbersFromGivenData" duration-ms="1" started-at="2018-03-06T11:53:00Z" data-provider="ValidDataProvider" finished-at="2018-03-06T11:53:00Z">
          <params>
            <param index="0">
              <value>
                <![CDATA[2]]>
              </value>
            </param>
            <param index="1">
              <value>
                <![CDATA[3]]>
              </value>
            </param>
            <param index="2">
              <value>
                <![CDATA[4]]>
              </value>
            </param>
          </params>
          <exception class="java.lang.AssertionError">
            <message>
              <![CDATA[expected [4] but found [5]]]>
            </message>
            <full-stacktrace>
              <![CDATA[java.lang.AssertionError: expected [4] but found [5]
	at org.testng.Assert.fail(Assert.java:93)
	at org.testng.Assert.failNotEquals(Assert.java:512)
	at org.testng.Assert.assertEqualsImpl(Assert.java:134)
	at org.testng.Assert.assertEquals(Assert.java:115)
	at org.testng.Assert.assertEquals(Assert.java:388)
	at org.testng.Assert.assertEquals(Assert.java:398)
	at com.xpand.java.CalcTest.CanAddNumbersFromGivenData(CalcTest.java:40)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
	at org.testng.TestNG.runSuites(TestNG.java:1144)
	at org.testng.TestNG.run(TestNG.java:1115)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283)
	at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:373)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:334)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:119)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:407)
]]>
            </full-stacktrace>
          </exception> <!-- java.lang.AssertionError -->
          <reporter-output>
          </reporter-output>
          <attributes>
            <attribute name="test">
              <![CDATA[]]>
            </attribute> <!-- test -->
            <attribute name="requirement">
              <![CDATA[CALC-1235]]>
            </attribute> <!-- requirement -->
            <attribute name="labels">
              <![CDATA[core]]>
            </attribute> <!-- labels -->
          </attributes>
        </test-method> <!-- CanAddNumbersFromGivenData -->
        <test-method status="PASS" signature="CanAddNumbersFromGivenData(int, int, int)[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="CanAddNumbersFromGivenData" duration-ms="0" started-at="2018-03-06T11:53:00Z" data-provider="ValidDataProvider" finished-at="2018-03-06T11:53:00Z">
          <params>
            <param index="0">
              <value>
                <![CDATA[-1]]>
              </value>
            </param>
            <param index="1">
              <value>
                <![CDATA[1]]>
              </value>
            </param>
            <param index="2">
              <value>
                <![CDATA[0]]>
              </value>
            </param>
          </params>
          <reporter-output>
          </reporter-output>
          <attributes>
            <attribute name="test">
              <![CDATA[]]>
            </attribute> <!-- test -->
            <attribute name="requirement">
              <![CDATA[CALC-1235]]>
            </attribute> <!-- requirement -->
            <attribute name="labels">
              <![CDATA[core]]>
            </attribute> <!-- labels -->
          </attributes>
        </test-method> <!-- CanAddNumbersFromGivenData -->
        <test-method status="FAIL" signature="CanDoStuff()[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="CanDoStuff" duration-ms="0" started-at="2018-03-06T11:53:00Z" finished-at="2018-03-06T11:53:00Z">
          <exception class="java.lang.AssertionError">
            <message>
              <![CDATA[null]]>
            </message>
            <full-stacktrace>
              <![CDATA[java.lang.AssertionError: null
	at org.testng.Assert.fail(Assert.java:93)
	at org.testng.Assert.assertNotEquals(Assert.java:897)
	at org.testng.Assert.assertNotEquals(Assert.java:902)
	at com.xpand.java.CalcTest.CanDoStuff(CalcTest.java:86)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
	at org.testng.TestNG.runSuites(TestNG.java:1144)
	at org.testng.TestNG.run(TestNG.java:1115)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283)
	at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:373)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:334)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:119)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:407)
]]>
            </full-stacktrace>
          </exception> <!-- java.lang.AssertionError -->
          <reporter-output>
          </reporter-output>
        </test-method> <!-- CanDoStuff -->
        <test-method status="PASS" signature="CanDivide()[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="CanDivide" duration-ms="0" started-at="2018-03-06T11:53:00Z" finished-at="2018-03-06T11:53:00Z">
          <reporter-output>
          </reporter-output>
          <attributes>
            <attribute name="test">
              <![CDATA[]]>
            </attribute> <!-- test -->
            <attribute name="requirement">
              <![CDATA[CALC-1235]]>
            </attribute> <!-- requirement -->
            <attribute name="labels">
              <![CDATA[core]]>
            </attribute> <!-- labels -->
          </attributes>
        </test-method> <!-- CanDivide -->
        <test-method status="PASS" signature="CanMultiplyX()[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="CanMultiplyX" duration-ms="0" started-at="2018-03-06T11:53:00Z" finished-at="2018-03-06T11:53:00Z">
          <reporter-output>
          </reporter-output>
          <attributes>
            <attribute name="test">
              <![CDATA[]]>
            </attribute> <!-- test -->
            <attribute name="requirement">
              <![CDATA[CALC-1235]]>
            </attribute> <!-- requirement -->
            <attribute name="labels">
              <![CDATA[core]]>
            </attribute> <!-- labels -->
          </attributes>
        </test-method> <!-- CanMultiplyX -->
        <test-method status="PASS" signature="CanSubtract()[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="CanSubtract" duration-ms="0" started-at="2018-03-06T11:53:00Z" finished-at="2018-03-06T11:53:00Z">
          <reporter-output>
          </reporter-output>
          <attributes>
            <attribute name="test">
              <![CDATA[]]>
            </attribute> <!-- test -->
            <attribute name="requirement">
              <![CDATA[CALC-1235]]>
            </attribute> <!-- requirement -->
            <attribute name="labels">
              <![CDATA[core]]>
            </attribute> <!-- labels -->
          </attributes>
        </test-method> <!-- CanSubtract -->
        <test-method status="PASS" signature="tearDown()[pri:0, instance:com.xpand.java.CalcTest@36d4b5c]" name="tearDown" is-config="true" duration-ms="0" started-at="2018-03-06T11:53:00Z" finished-at="2018-03-06T11:53:00Z">
          <reporter-output>
          </reporter-output>
        </test-method> <!-- tearDown -->
      </class> <!-- com.xpand.java.CalcTest -->
    </test> <!-- calculator -->
  </suite> <!-- TestAll -->
</testng-results> 
Code Block
titleTest Exec Info JSON
{
	"fields": {
		"project": {
			"id": "10402"
		},
		"summary": "Test Execution for TestNG Execution",
		"issuetype": {
			"id": "10007"
		},
		"components" : [
			{
			"name":"Interface"
			},
			{
			"name":"Core"
			}
		]
	}
}
Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" -F "info=@testExec.json" http://yourserver/rest/raven/1.0/import/execution/testng/multipart

Responses

200 OK : application/json : Successful. The results where successfully imported to Jira.

Code Block
titleExample OutputTest Info JSON
{
    "testExecIssuefields": {
        "iddescription": "10200Automated Test",
       "key "priority" : {
        	"id": "XNP-24",10"
        },   
        "selflabels": [
            "Testing",
       "http://www.example.com/jira/rest/api/2/issue/10200"
  }
}

400 BAD_REQUEST : application/json : Returns the error.

401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.

NUnit XML results

After executing NUnit tests, you must import the outputted XML execution results to Jira using the following endpoint:

POST nunit
     "Automation"
        ]
    }
}


Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" -F "info=@testExec.json" -F "testInfo=@test.json" http://yourserver

Expand
title

/rest/raven/1.0/import/execution/testng/

multipart/form-data:

"file" : a MultipartFormParam containing a XML file to import.

Example

multipart

Panel
borderColor#ccc
borderStylesolid

Responses

200 OK : application/json : Successful. The results where successfully imported to Jira. The following Test issues were also created with success.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
  },
  "testIssues": {
        "success": [
            {
                "self": "http://localhost:8080/rest/api/2/issue/10201",
                "id": "10201",
                "key": "XNP-25"
            },
            {
                "self": "http://localhost:8080/rest/api/2/issue/10202",
                "id": "10202",

Import the execution results created with the NUnit XML output formatter. For more information please check the documentation about NUnit integration.

Request

QUERY PARAMETERS
parametertypedescription
projectKeyString

- key of the project where the Test Execution (if the testExecKey parameter wasn't provided) and the tests (if they aren't created yet) are going to be created.

testExecKeyString- key of the Test Execution.
testPlanKeyString- key of the Test Plan; if you specify the Test Plan, the Tests will be added automatically to the Test Plan if they're not part of it.
testEnvironmentsString- a string containing a list of test environments separated by ";"
revisionString- source code and documentation version used in the test execution.
fixVersionString

- the Fix Version associated with the test execution (it supports only one value).

Code Block
titleNUnit Report XML
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-run id="0" testcasecount="14" total="14" passed="13" failed="1" inconclusive="0" skipped="0" asserts="14" result="Failed" portable-engine-version="3.3.0.0" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.140400">
<test-suite type="Assembly" id="1021" name="x, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" fullname="x, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" runstate="Runnable" testcasecount="14" result="Failed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.110549" total="14" passed="13" failed="1" inconclusive="0" skipped="0" asserts="14">
  <settings>
    <setting name="WorkDirectory" value="C:\Users\Sergio\x" />
  </settings>
  <failure>
    <message><![CDATA[One or more child tests had errors]]></message>
  </failure>
  <test-suite type="TestFixture" id="1000" name="TestClass" fullname="TestClass" classname="TestClass" runstate="Runnable" testcasecount="2" result="Failed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.084668" total="2" passed="1" failed="1" inconclusive="0" skipped="0" asserts="2">
    <failure>
      <message><![CDATA[One or more child tests had errors]]></message>
    </failure>
    <test-suite type="ParameterizedMethod" id="1003" name="SubtractTest" fullname="TestClass.SubtractTest" classname="TestClass" runstate="Runnable" testcasecount="2" result="Failed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.080887" total="2" passed="1" failed="1" inconclusive="0" skipped="0" asserts="2">
        <properties>
            <property name="Requirementkey": value="DEVXNP-77126" />
          </properties><failure>
    }
    <message><![CDATA[One or more child tests had errors]]></message>
      </failure>
      <test-case id="1001" name="SubtractTest(1)" fullname="TestClass.SubtractTest(1)" methodname="SubtractTest" classname="TestClass" runstate="Runnable" seed="1166833138" result="Failed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.043525" asserts="1">
}
}

200 OK : application/json: Some results where successfully imported to Jira. But the following Test issues failed to be created due to the following reasons.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
  },
  "testIssues": {
        "error": [
           <failure> {
          <message><![CDATA[      Expected"messages": 10
But was:  1
]]></message>
[
                    "Field 'customfield_10005'  <stack-trace><![CDATA[at TestClass.SubtractTest(Int32 x) in C:\Users\Sergio\x\TestClass.cs:line 13
]]></stack-trace>
cannot be set. It is not on the appropriate screen, or unknown."
                </failure>],
      </test-case>
        <test-case id="1002" "testDefinition": "com.xpand.java.CalcTest.CanAddNumbersFromGivenData"
            }
        ]
    }
}

400 BAD_REQUEST : application/json : Returns the error.

401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.

NUnit XML results

After executing NUnit tests, you must import the outputted XML execution results to Jira using the following endpoint:


Expand
titlePOST /rest/raven/1.0/import/execution/nunit
Panel
borderColor#ccc
borderStylesolid

Import the execution results created with the NUnit XML output formatter. For more information please check the documentation about NUnit integration.

Request

QUERY PARAMETERS
parametertypedescription
projectKeyString

- key of the project where the Test Execution (if the testExecKey parameter wasn't provided) and the tests (if they aren't created yet) are going to be created.

testExecKeyString- key of the Test Execution.
testPlanKeyString- key of the Test Plan; if you specify the Test Plan, the Tests will be added automatically to the Test Plan if they're not part of it.
testEnvironmentsString- a string containing a list of test environments separated by ";"
revisionString- source code and documentation version used in the test execution.
fixVersionString

- the Fix Version associated with the test execution (it supports only one value).

multipart/form-data:

"file" : a MultipartFormParam containing a XML file to import.

Example

Code Block
titleNUnit Report XML
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-run id="0" testcasecount="14" total="14" passed="13" failed="1" inconclusive="0" skipped="0" asserts="14" result="Failed" portable-engine-version="3.3.0.0name="SubtractTest(10)" fullname="TestClass.SubtractTest(10)" methodname="SubtractTest" classname="TestClass" runstate="Runnable" seed="1003146807" result="Failed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="12.000098" asserts="1" />
    </test-suite>
  </test-suite>
  <test-suite type="TestSuite" id="1022" name="x" fullname="x" runstate="Runnable" testcasecount="12" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.015218" total="12" passed="12" failed="0" inconclusive="0" skipped="0" asserts="12">
    <test-suite type="TestFixture" id="1004" name="CalculatorTests" fullname="x.CalculatorTests" classname="x.CalculatorTests" runstate="Runnable" testcasecount="12" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.014979140400">
<test-suite totaltype="12Assembly" passedid="121021" failedname="0"x, inconclusive="0" skipped="0" asserts="12">
      <test-suite type="ParameterizedMethod" id="1008" name="CanAddNumbers" fullname="x.CalculatorTests.CanAddNumbers" classname="x.CalculatorTestsVersion=1.0.0.0, Culture=neutral, PublicKeyToken=null" fullname="x, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" runstate="Runnable" testcasecount="314" result="Passed"Failed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.004228110549" total="314" passed="313" failed="01" inconclusive="0" skipped="0" asserts="314">
          <properties><settings>
            <property <setting name="RequirementWorkDirectory" value="DEV-771C:\Users\Sergio\x" />
  </settings>
  <failure>
    <message><![CDATA[One or </properties>
more child tests had errors]]></message>
  </failure>
  <test-casesuite idtype="1005TestFixture" nameid="CanAddNumbers(1,1,2)1000" fullnamename="x.CalculatorTests.CanAddNumbers(1,1,2)TestClass" methodnamefullname="CanAddNumbersTestClass" classname="x.CalculatorTestsTestClass" runstate="Runnable" seedtestcasecount="18463895842" result="PassedFailed" start-timesite="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.001194084668" assertstotal="12" />
        <test-case idpassed="10061" namefailed="CanAddNumbers(-1,-1,-2)" fullnameinconclusive="x.CalculatorTests.CanAddNumbers(-1,-1,-2)0" methodnameskipped="CanAddNumbers0" classnameasserts="x.CalculatorTests" runstate="Runnable" seed="1113780989" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000067" asserts="1" />2">
    <failure>
      <message><![CDATA[One or more child tests had errors]]></message>
    </failure>
    <test-casesuite type="ParameterizedMethod" id="10071003" name="CanAddNumbers(100,5,105)SubtractTest" fullname="x.CalculatorTests.CanAddNumbers(100,5,105)TestClass.SubtractTest" methodnameclassname="CanAddNumbersTestClass" classnamerunstate="x.CalculatorTestsRunnable" runstatetestcasecount="Runnable2" seedresult="1585332966Failed" resultsite="PassedChild" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000103080887" total="2" passed="1" assertsfailed="1" /inconclusive="0" skipped="0" asserts="2">
       </test-suite>
 <properties>
       <test-suite type="ParameterizedMethod" id="1020" name="CanDivide" fullname="x.CalculatorTests.CanDivide" classname="x.CalculatorTests" runstate="Runnable" testcasecount="3" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.004041" total="3" passed="3" failed="0" inconclusive="0" skipped="0" asserts="3" <property name="Requirement" value="DEV-771" />
          <properties></properties><failure>
        <message><![CDATA[One or more child <property name="Requirement" value="DEV-771" />tests had errors]]></message>
          </properties>failure>
        <test-case id="10171001" name="CanDivideSubtractTest(1,1,1)" fullname="xTestClass.CalculatorTests.CanDivideSubtractTest(1,1,1)" methodname="CanDivideSubtractTest" classname="x.CalculatorTestsTestClass" runstate="Runnable" seed="12855012521166833138" result="PassedFailed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000354043525" asserts="1" />
        <failure>
 <test-case id="1018" name="CanDivide(-1,-1,1)" fullname="x.CalculatorTests.CanDivide(-1,-1,1)" methodname="CanDivide" classname="x.CalculatorTests" runstate="Runnable" seed="1436436719" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000073" asserts="1" /> <message><![CDATA[  Expected: 10
But was:  1
]]></message>
          <stack-trace><![CDATA[at TestClass.SubtractTest(Int32 x) in C:\Users\Sergio\x\TestClass.cs:line 13
]]></stack-trace>
        </failure>
      </test-case>
      <test-case id="10191002" name="CanDivide(100,5,20SubtractTest(10)" fullname="xTestClass.CalculatorTests.CanDivide(100,5,20SubtractTest(10)" methodname="CanDivideSubtractTest" classname="x.CalculatorTestsTestClass" runstate="Runnable" seed="2133108881003146807" result="PassedFailed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="012.000060000098" asserts="1" />
    </test-suite>
  </test-suite>
      <test-suite type="ParameterizedMethodTestSuite" id="10161022" name="CanMultiplyx" fullname="x.CalculatorTests.CanMultiply" classname="x.CalculatorTests" runstate="Runnable" testcasecount="312" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.002759015218" total="312" passed="312" failed="0" inconclusive="0" skipped="0" asserts="312">
        <test-casesuite type="TestFixture" id="10131004" name="CanMultiply(1,1,1)CalculatorTests" fullname="x.CalculatorTests.CanMultiply(1,1,1)" methodname="CanMultiply" classname="x.CalculatorTests" runstate="Runnable" seedtestcasecount="119273512712" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000331014979" assertstotal="112">
 passed="12" failed="0"                <properties>
            <property name="label" value="multiplication" /inconclusive="0" skipped="0" asserts="12">
          </properties>
          </test-case>
        <test-case id="1014<test-suite type="ParameterizedMethod" id="1008" name="CanMultiply(-1,-1,1)CanAddNumbers" fullname="x.CalculatorTests.CanMultiply(-1,-1,1)CanAddNumbers" methodname="CanMultiply" classname="x.CalculatorTests" runstate="Runnable" seedtestcasecount="399880643" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000059004228" assertstotal="13">
 passed="3" failed="0" inconclusive="0"     skipped="0" asserts="3">
          <properties>
            <property name="labelRequirement" value="multiplicationDEV-771" />
          </properties>
          </test-case>
        <test-case id="10151005" name="CanMultiplyCanAddNumbers(1001,51,5002)" fullname="x.CalculatorTests.CanMultiplyCanAddNumbers(1001,51,5002)" methodname="CanMultiplyAgainCanAddNumbers" classname="x.CalculatorTests" runstate="Runnable" seed="14623462431846389584" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000052001194" asserts="1" />
                  <properties>
            <property name="requirement" value="DEV-34" />
          </properties>
          </test-case><test-case id="1006" name="CanAddNumbers(-1,-1,-2)" fullname="x.CalculatorTests.CanAddNumbers(-1,-1,-2)" methodname="CanAddNumbers" classname="x.CalculatorTests" runstate="Runnable" seed="1113780989" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000067" asserts="1" />
        <test-case id="1007" name="CanAddNumbers(100,5,105)" fullname="x.CalculatorTests.CanAddNumbers(100,5,105)" methodname="CanAddNumbers" classname="x.CalculatorTests" runstate="Runnable" seed="1585332966" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000103" asserts="1" />
      </test-suite>
      <test-suite type="ParameterizedMethod" id="10121020" name="CanSubtractCanDivide" fullname="x.CalculatorTests.CanSubtractCanDivide" classname="x.CalculatorTests" runstate="Runnable" testcasecount="3" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.002827004041" total="3" passed="3" failed="0" inconclusive="0" skipped="0" asserts="3">
          <properties>
            <property name="requirementRequirement" value="DEV-328771" />
          </properties>
        <test-case id="10091017" name="CanSubtractCanDivide(1,1,01)" fullname="x.CalculatorTests.CanSubtractCanDivide(1,1,01)" methodname="CanSubtractCanDivide" classname="x.CalculatorTests" runstate="Runnable" seed="10193577341285501252" result="FailedPassed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000303000354" asserts="1" />
        <test-case  <failure>
            <message><![CDATA[Error subtracting]]></message>
          </failure>id="1018" name="CanDivide(-1,-1,1)" fullname="x.CalculatorTests.CanDivide(-1,-1,1)" methodname="CanDivide" classname="x.CalculatorTests" runstate="Runnable" seed="1436436719" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000073" asserts="1" />
      </test-case>
        <test-case id="10101019" name="CanSubtractCanDivide(-1100,-15,020)" fullname="x.CalculatorTests.CanSubtractCanDivide(-1100,-15,020)" methodname="CanSubtractCanDivide" classname="x.CalculatorTests" runstate="Runnable" seed="1322022615213310888" result="FailedPassed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000056000060" asserts="1" >
              <failure>
  />
      <message><![CDATA[Error subtracting]]></message>
      </failure>
      </test-case>suite>
        <test-casesuite type="ParameterizedMethod" id="10111016" name="CanSubtract(100,5,95)CanMultiply" fullname="x.CalculatorTests.CanSubtract(100,5,95)CanMultiply" methodname="CanSubtract" classname="x.CalculatorTests" runstate="Runnable" seedtestcasecount="44935533" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000053002759" total="3" passed="3" failed="0" inconclusive="0" skipped="0" asserts="13" />
      </test-suite>
    </test-suite>
  </test-suite>
</test-suite>
</test-run>
Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/nunit?projectKey=XTP

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/nunit?testExecKey=XNP-23

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/nunit?projectKey=XTP&testExecKey=XNP-23

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/nunit?projectKey=XTP&testPlanKey=XTP-12&revision=v2.1.0

Responses

200 OK : application/json : Successful. The results where successfully imported to Jira.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
  }
}

400 BAD_REQUEST : application/json : Returns the error.

401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.

NUnit XML results Multipart

Xray provides another endpoint if you want to create new Test Executions and have control over newly-created Test Execution fields. It allows you to send one XML file (the NUnit report) and a JSON similar to the one Jira uses to create new issues. For more information about that second format, check the Jira documentation here.

Expand
titlePOST /rest/raven/1.0/import/execution/nunit/multipart
Panel
borderColor#ccc
borderStylesolid

Import the execution results created with the NUnit XML output formatter. For more information please check the documentation about NUnit integration.

Note: Currently, if you specify the Test Plan custom field, the Tests of the Test Execution will not be added automatically to the Test Plan.

Request

Example

Code Block
titleNUnit Report XML
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-run id="0" testcasecount="14" total="14" passed="13" failed="1" inconclusive="0" skipped="0" asserts="14" result="Failed" portable-engine-version="3.3.0.0" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.140400">
<test-suite type="Assembly" id="1021" name="x, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" fullname="x, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null  <test-case id="1013" name="CanMultiply(1,1,1)" fullname="x.CalculatorTests.CanMultiply(1,1,1)" methodname="CanMultiply" classname="x.CalculatorTests" runstate="Runnable" seed="1192735127" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000331" asserts="1">
                  <properties>
            <property name="label" value="multiplication" />
          </properties>
          </test-case>
        <test-case id="1014" name="CanMultiply(-1,-1,1)" fullname="x.CalculatorTests.CanMultiply(-1,-1,1)" methodname="CanMultiply" classname="x.CalculatorTests" runstate="Runnable" seed="39988064" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000059" asserts="1">
                  <properties>
            <property name="label" value="multiplication" />
          </properties>
          </test-case>
        <test-case id="1015" name="CanMultiply(100,5,500)" fullname="x.CalculatorTests.CanMultiply(100,5,500)" methodname="CanMultiplyAgain" classname="x.CalculatorTests" runstate="Runnable" testcasecountseed="141462346243" result="FailedPassed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.110549000052" totalasserts="14" passed="13" failed="1" inconclusive="0" skipped="0" asserts="14">
  <settings>
    <setting            <properties>
            <property name="WorkDirectoryrequirement" value="C:\Users\Sergio\xDEV-34" />
          </settings>properties>
  <failure>
      <message><![CDATA[One or more child tests had errors]]></message>
 </test-case>
      </failure>test-suite>
      <test-suite type="TestFixtureParameterizedMethod" id="10001012" name="TestClassCanSubtract" fullname="TestClassx.CalculatorTests.CanSubtract" classname="TestClassx.CalculatorTests" runstate="Runnable" testcasecount="23" result="FailedPassed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.084668002827" total="23" passed="13" failed="10" inconclusive="0" skipped="0" asserts="23">
          <failure><properties>
         <message><![CDATA[One or more child tests had errors]]></message>
<property name="requirement" value="DEV-328" />
          </failure>properties>
        <test-suitecase typeid="ParameterizedMethod1009" idname="1003CanSubtract(1,1,0)" namefullname="SubtractTestx.CalculatorTests.CanSubtract(1,1,0)" fullnamemethodname="TestClass.SubtractTestCanSubtract" classname="TestClassx.CalculatorTests" runstate="Runnable" testcasecountseed="21019357734" result="Failed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.080887000303" totalasserts="2" passed="1">
 failed="1" inconclusive="0" skipped="0" asserts="2">
        <properties><failure>
            <property name="Requirement" value="DEV-771" /><message><![CDATA[Error subtracting]]></message>
          </properties><failure>failure>
        <message><![CDATA[One or more child tests had errors]]></message>
      </failure>
</test-case>
        <test-case id="10011010" name="SubtractTestCanSubtract(-1,-1,0)" fullname="TestClassx.CalculatorTests.SubtractTestCanSubtract(-1,-1,0)" methodname="SubtractTestCanSubtract" classname="TestClassx.CalculatorTests" runstate="Runnable" seed="11668331381322022615" result="Failed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.043525000056" asserts="1" >
        <failure>
          <message><![CDATA[  Expected: 10
But was:  1
]]></message>
<failure>
             <stack-trace><<message><![CDATA[at TestClass.SubtractTest(Int32 x) in C:\Users\Sergio\x\TestClass.cs:line 13
Error subtracting]]></stack-trace>message>
        </failure>
      </test-case>
        <test-case id="10021011" name="SubtractTest(10CanSubtract(100,5,95)" fullname="TestClassx.CalculatorTests.SubtractTest(10CanSubtract(100,5,95)" methodname="SubtractTestCanSubtract" classname="TestClassx.CalculatorTests" runstate="Runnable" seed="10031468074493553" result="FailedPassed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="120.000098000053" asserts="1" />
      </test-suite>
    </test-suite>
  </test-suite>
</test-suite>
</test-run>


Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/nunit?projectKey=XTP

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/nunit?testExecKey=XNP-23

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/nunit?projectKey=XTP&testExecKey=XNP-23

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/nunit?projectKey=XTP&testPlanKey=XTP-12&revision=v2.1.0

Responses

200 OK : application/json : Successful. The results where successfully imported to Jira.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
  }
}

400 BAD_REQUEST : application/json : Returns the error.

401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.

NUnit XML results Multipart

Xray provides another endpoint if you want to create new Test Executions and have control over newly-created Test Execution and Test fields. It allows you to send one XML file (the NUnit report) and two JSON files similar to the one Jira uses to create new issues. For more information about the JSON format, check the Jira documentation here.

As of the creation of Test issues, some field values in the JSON file will follow some rules:

  • Issue Type: Overridden by the Test issue type;
  • Summary: Overridden by the internally generated summary;
  • Parent: This field is ignored;
  • Project: If the there is not a Test issue with the same Generic Test Definition, then it will be created in the provided project;
  • Generic Test Definition: Not allowed to provide a value for this field.


Expand
titlePOST /rest/raven/1.0/import/execution/nunit/multipart
Panel
borderColor#ccc
borderStylesolid

Import the execution results created with the NUnit XML output formatter. For more information please check the documentation about NUnit integration.

Note: Currently, if you specify the Test Plan custom field, the Tests of the Test Execution will not be added automatically to the Test Plan.

Request

Example

Code Block
titleNUnit Report XML
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-run id="0" testcasecount="14" total="14" passed="13" failed="1" inconclusive="0" skipped="0" asserts="14" result="Failed" portable-engine-version="3.3.0.0" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.140400">
<test-suite type="Assembly" id="1021" name="x, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" fullname="x, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" runstate="Runnable" testcasecount="14" result="Failed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.110549" total="14" passed="13" failed="1" inconclusive="0" skipped="0" asserts="14">
  <settings>
    <setting name="WorkDirectory" value="C:\Users\Sergio\x" />
  </settings>
  <failure>
    <message><![CDATA[One or more child tests had errors]]></message>
  </failure>
  <test-suite type="TestFixture" id="1000" name="TestClass" fullname="TestClass" classname="TestClass" runstate="Runnable" testcasecount="2" result="Failed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.084668" total="2" passed="1" failed="1" inconclusive="0" skipped="0" asserts="2">
    <failure>
      <message><![CDATA[One or more child tests had errors]]></message>
    </failure>
    <test-suite type="ParameterizedMethod" id="1003" name="SubtractTest" fullname="TestClass.SubtractTest" classname="TestClass" runstate="Runnable" testcasecount="2" result="Failed" site="Child" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.080887" total="2" passed="1" failed="1" inconclusive="0" skipped="0" asserts="2">
        <properties>
            <property name="Requirement" value="DEV-771" />
          </properties><failure>
        <message><![CDATA[One or more child tests had errors]]></message>
      </failure>
      <test-case id="1001" name="SubtractTest(1)" fullname="TestClass.SubtractTest(1)" methodname="SubtractTest" classname="TestClass" runstate="Runnable" seed="1166833138" result="Failed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.043525" asserts="1">
        <failure>
          <message><![CDATA[  Expected: 10
But was:  1
]]></message>
          <stack-trace><![CDATA[at TestClass.SubtractTest(Int32 x) in C:\Users\Sergio\x\TestClass.cs:line 13
]]></stack-trace>
        </failure>
      </test-case>
      <test-case id="1002" name="SubtractTest(10)" fullname="TestClass.SubtractTest(10)" methodname="SubtractTest" classname="TestClass" runstate="Runnable" seed="1003146807" result="Failed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="12.000098" asserts="1" />
    </test-suite>
  </test-suite>
  <test-suite type="TestSuite" id="1022" name="x" fullname="x" runstate="Runnable" testcasecount="12" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.015218" total="12" passed="12" failed="0" inconclusive="0" skipped="0" asserts="12">
    <test-suite type="TestFixture" id="1004" name="CalculatorTests" fullname="x.CalculatorTests" classname="x.CalculatorTests" runstate="Runnable" testcasecount="12" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.014979" total="12" passed="12" failed="0" inconclusive="0" skipped="0" asserts="12">
      <test-suite type="ParameterizedMethod" id="1008" name="CanAddNumbers" fullname="x.CalculatorTests.CanAddNumbers" classname="x.CalculatorTests" runstate="Runnable" testcasecount="3" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.004228" total="3" passed="3" failed="0" inconclusive="0" skipped="0" asserts="3">
          <properties>
            <property name="Requirement" value="DEV-771" />
          </properties>
        <test-case id="1005" name="CanAddNumbers(1,1,2)" fullname="x.CalculatorTests.CanAddNumbers(1,1,2)" methodname="CanAddNumbers" classname="x.CalculatorTests" runstate="Runnable" seed="1846389584" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.001194" asserts="1" />
        <test-case id="1006" name="CanAddNumbers(-1,-1,-2)" fullname="x.CalculatorTests.CanAddNumbers(-1,-1,-2)" methodname="CanAddNumbers" classname="x.CalculatorTests" runstate="Runnable" seed="1113780989" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000067" asserts="1" />
        <test-case id="1007" name="CanAddNumbers(100,5,105)" fullname="x.CalculatorTests.CanAddNumbers(100,5,105)" methodname="CanAddNumbers" classname="x.CalculatorTests" runstate="Runnable" seed="1585332966" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000103" asserts="1" />
      </test-suite>
      <test-suite type="ParameterizedMethod" id="1020" name="CanDivide" fullname="x.CalculatorTests.CanDivide" classname="x.CalculatorTests" runstate="Runnable" testcasecount="3" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.004041<test-suite type="TestSuite" id="1022" name="x" fullname="x" runstate="Runnable" testcasecount="12" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.015218" total="12" passed="12" failed="0" inconclusive="0" skipped="0" asserts="12">
    <test-suite type="TestFixture" id="1004" name="CalculatorTests" fullname="x.CalculatorTests" classname="x.CalculatorTests" runstate="Runnable" testcasecount="12" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.014979" total="12" passed="12" failed="0" inconclusive="0" skipped="0" asserts="12">
      <test-suite type="ParameterizedMethod" id="1008" name="CanAddNumbers" fullname="x.CalculatorTests.CanAddNumbers" classname="x.CalculatorTests" runstate="Runnable" testcasecount="3" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.004228" total="3" passed="3" failed="0" inconclusive="0" skipped="0" asserts="3">
          <properties>
            <property name="Requirement" value="DEV-771" />
          </properties>
        <test-case id="10051017" name="CanAddNumbersCanDivide(1,1,21)" fullname="x.CalculatorTests.CanAddNumbersCanDivide(1,1,21)" methodname="CanAddNumbersCanDivide" classname="x.CalculatorTests" runstate="Runnable" seed="18463895841285501252" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.001194000354" asserts="1" />
        <test-case id="10061018" name="CanAddNumbersCanDivide(-1,-1,-21)" fullname="x.CalculatorTests.CanAddNumbersCanDivide(-1,-1,-21)" methodname="CanAddNumbersCanDivide" classname="x.CalculatorTests" runstate="Runnable" seed="11137809891436436719" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000067000073" asserts="1" />
        <test-case id="10071019" name="CanAddNumbersCanDivide(100,5,10520)" fullname="x.CalculatorTests.CanAddNumbersCanDivide(100,5,10520)" methodname="CanAddNumbersCanDivide" classname="x.CalculatorTests" runstate="Runnable" seed="1585332966213310888" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000103000060" asserts="1" />
      </test-suite>
      <test-suite type="ParameterizedMethod" id="10201016" name="CanDivideCanMultiply" fullname="x.CalculatorTests.CanDivideCanMultiply" classname="x.CalculatorTests" runstate="Runnable" testcasecount="3" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.004041002759" total="3" passed="3" failed="0" inconclusive="0" skipped="0" asserts="3">
          <properties>
            <property name="Requirement" value="DEV-771" />
          </properties>
        <test-case id="10171013" name="CanDivideCanMultiply(1,1,1)" fullname="x.CalculatorTests.CanDivideCanMultiply(1,1,1)" methodname="CanDivideCanMultiply" classname="x.CalculatorTests" runstate="Runnable" seed="12855012521192735127" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000354000331" asserts="1">
                  <properties>
            <property name="label" value="multiplication" />
          </properties>
          </test-case>
        <test-case id="10181014" name="CanDivideCanMultiply(-1,-1,1)" fullname="x.CalculatorTests.CanDivideCanMultiply(-1,-1,1)" methodname="CanDivideCanMultiply" classname="x.CalculatorTests" runstate="Runnable" seed="143643671939988064" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000073000059" asserts="1">
                  <properties>
            <property name="label" />value="multiplication" />
          </properties>
          </test-case>
        <test-case id="10191015" name="CanDivideCanMultiply(100,5,20500)" fullname="x.CalculatorTests.CanDivideCanMultiply(100,5,20500)" methodname="CanDivideCanMultiplyAgain" classname="x.CalculatorTests" runstate="Runnable" seed="2133108881462346243" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000060000052" asserts="1">
                  <properties>
            <property name="requirement" value="DEV-34" />
          </properties>
          </test-case>
      </test-suite>
      <test-suite type="ParameterizedMethod" id="10161012" name="CanMultiplyCanSubtract" fullname="x.CalculatorTests.CanMultiplyCanSubtract" classname="x.CalculatorTests" runstate="Runnable" testcasecount="3" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.002759002827" total="3" passed="3" failed="0" inconclusive="0" skipped="0" asserts="3">
        <test-case id="1013" name="CanMultiply(1,1,1)" fullname="x.CalculatorTests.CanMultiply(1,1,1)" methodname="CanMultiply" classname="x.CalculatorTests" runstate="Runnable" seed="1192735127" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000331" asserts="1">
                  <properties>
            <property name="labelrequirement" value="multiplicationDEV-328" />
          </properties>
          </test-case>properties>
        <test-case id="10141009" name="CanMultiplyCanSubtract(-1,-1,10)" fullname="x.CalculatorTests.CanMultiplyCanSubtract(-1,-1,10)" methodname="CanMultiplyCanSubtract" classname="x.CalculatorTests" runstate="Runnable" seed="399880641019357734" result="PassedFailed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000059000303" asserts="1">
                  <properties><failure>
            <property name="label" value="multiplication" /><message><![CDATA[Error subtracting]]></message>
          </properties>failure>
          </test-case>
        <test-case id="10151010" name="CanMultiplyCanSubtract(100-1,5-1,5000)" fullname="x.CalculatorTests.CanMultiplyCanSubtract(100-1,5-1,5000)" methodname="CanMultiplyAgainCanSubtract" classname="x.CalculatorTests" runstate="Runnable" seed="14623462431322022615" result="PassedFailed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000052000056" asserts="1" >
                  <properties><failure>
            <property name="requirement" value="DEV-34" />
  <message><![CDATA[Error subtracting]]></message>
        </properties>failure>
          </test-case>
      </test-suite>
      <test-suite type="ParameterizedMethod" case id="10121011" name="CanSubtract(100,5,95)" fullname="x.CalculatorTests.CanSubtract(100,5,95)" methodname="CanSubtract" classname="x.CalculatorTests" runstate="Runnable" testcasecountseed="34493553" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000053" asserts="1" />
      </test-suite>
    </test-suite>
  </test-suite>
</test-suite>
</test-run>
Code Block
titleTest Exec Info JSON
{
	"fields": {
		"project": {
			"id": "10402"
		},
		"summary": "Test Execution for nunit Execution",
		"issuetype": {
			"id": "10007"
		},
		"components" : [
			{
			"name":"Interface"
			},
			{
			"name":"Core"
			}
		]
	}
}
Code Block
titleTest Info JSON
{
    "fields": {
 duration="0.002827" total="3" passed="3" failed="0" inconclusive="0" skipped="0" asserts="3">
          <properties>
            <property name="requirement" value="DEV-328" />
          </properties>
        <test-case id="1009description": name="CanSubtract(1,1,0)" fullname="x.CalculatorTests.CanSubtract(1,1,0)" methodname="CanSubtract" classname="x.CalculatorTests" runstate="Runnable" seed="1019357734" result="Failed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000303" asserts="1">"Automated Test",
        "priority" : {
        	"id": "10"
        },  <failure> 
        "labels": [
      <message><![CDATA[Error subtracting]]></message>
      "Testing",
      </failure>
      </test-case>
"Automation"
        ]
  <test-case id="1010" name="CanSubtract(-1,-1,0)" fullname="x.CalculatorTests. }
}


Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" -F "info=@testExec.json" -F "testInfo=@test.json" http://yourserver/rest/raven/1.0/import/execution/nunit/multipart

Responses

200 OK : application/json : Successful. The results where successfully imported to Jira. The following Test issues were also created with success.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
  },
  "testIssues": {
 CanSubtract(-1,-1,0)" methodname="CanSubtract" classname="x.CalculatorTests" runstate="Runnable" seed="1322022615" result="Failed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000056" asserts="1" >
              <failure>
       "success": <message><![CDATA[Error subtracting]]></message>
      </failure>
      </test-case>{
        <test-case id="1011" name="CanSubtract(100,5,95)" fullname="x.CalculatorTests.CanSubtract(100,5,95)" methodname="CanSubtract" classname="x.CalculatorTests" runstate="Runnable" seed="4493553" result="Passed" start-time="2016-12-26 14:36:03Z" end-time="2016-12-26 14:36:03Z" duration="0.000053" asserts="1" />
      </test-suite>
    </test-suite>
  </test-suite>
</test-suite>
</test-run>
Code Block
titleInfo JSON
{
	"fields": {
		"project": {
			self": "http://localhost:8080/rest/api/2/issue/10201",
                "id": "1040210201"
		},
		"summary": "Test Execution for nunit Execution",
		"issuetype": {
			"id": "10007"
		},
		"components" : [
			{
			"name":"Interface"
			},
			{
			"name":"Core"
			}
		]
	}
}
Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" -F "info=@testExec.json" http://yourserver/rest/raven/1.0/import/execution/nunit/multipart

Responses
,
                "key": "XNP-25"
            },
            {
                "self": "http://localhost:8080/rest/api/2/issue/10202",
                "id": "10202",
                "key": "XNP-26"
            }
        ]
    }
}

200 OK : application/json: Successful. The Some results where successfully imported to Jira. But the following Test issues failed to be created due to the following reasons.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
/2/issue/10200"
  },
  "testIssues": {
        "error": [
            {
                "messages": [
                    "Field 'customfield_10005' cannot be set. It is not on the appropriate screen, or unknown."
                ],
                "testDefinition": "x.CalculatorTests.CanMultiply"
            }
        ]
    }
}

400 BAD_REQUEST : application/json : Returns the error.

401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.

...

Expand
titlePOST /rest/raven/1.0/import/execution/robot
Panel
borderColor#ccc
borderStylesolid

Import the execution results from Robot Framework XML output format.

Request

QUERY PARAMETERS
parametertypedescription
projectKeyString

- key of the project where the Test Execution (if the testExecKey parameter wasn't provided) and the tests (if they aren't created yet) are going to be created.

testExecKeyString- key of the Test Execution.
testPlanKeyString- key of the Test Plan; if you specify the Test Plan, the Tests will be added automatically to the Test Plan if they're not part of it.
testEnvironmentsString- a string containing a list of test environments separated by ";"
revisionString- source code and documentation version used in the test execution.
fixVersionString

- the Fix Version associated with the test execution (it supports only one value).

multipart/form-data:

"file" : a MultipartFormParam containing a XML file to import.

Example

Code Block
titleRobot Report XML
<?xml version="1.0" encoding="UTF-8"?>
<robot generated="20170220 14:18:54.562" generator="Robot 3.0.2 (Python 2.7.13 on win32)">
  <suite source="C:\Users\lmfv\Documents\Saco de Features\xray-1238\robot-example\robotframework-webdemo\login_tests" id="s1" name="Login Tests">
    <suite source="C:\Users\lmfv\Documents\Saco de Features\xray-1238\robot-example\robotframework-webdemo\login_tests\gherkin_login.robot" id="s1-s1" name="Gherkin Login">
      <test id="s1-s1-t1" name="Gherkin Valid Login">
        <kw name="Given browser is opened to login page">
          <kw name="Login Page Should Be Open" library="resource">
            <kw name="Title Should Be" library="Selenium2Library">
              <doc>Verifies that current page title equals `title`.</doc>
              <arguments>
                <arg>Log in - Your Company JIRA</arg>
              </arguments>
              <msg timestamp="20170220 14:19:07.693" level="INFO">Page title is 'Log in - Your Company JIRA'.</msg>
              <status status="PASS" endtime="20170220 14:19:07.693" starttime="20170220 14:19:07.158">
              </status>
            </kw>
            <status status="PASS" endtime="20170220 14:19:07.693" starttime="20170220 14:19:07.158">
            </status>
          </kw>
          <status status="PASS" endtime="20170220 14:19:07.693" starttime="20170220 14:18:55.937">
          </status>
        </kw>
        <kw name="When user &quot;admin&quot; logs in with password &quot;password123&quot;">
          <kw name="Input Username" library="resource">
            <arguments>
              <arg>${username}</arg>
            </arguments>
            <kw name="Input Text" library="Selenium2Library">
              <doc>Types the given `text` into text field identified by `locator`.</doc>
              <arguments>
                <arg>login-form-username</arg>
                <arg>${username}</arg>
              </arguments>
              <msg timestamp="20170220 14:19:07.696" level="INFO">Typing text 'admin' into text field 'login-form-username'</msg>
              <status status="PASS" endtime="20170220 14:19:09.314" starttime="20170220 14:19:07.696">
              </status>
            </kw>
            <status status="PASS" endtime="20170220 14:19:09.314" starttime="20170220 14:19:07.695">
            </status>
          </kw>
          <kw name="Input Password" library="resource">
            <arguments>
              <arg>${password}</arg>
            </arguments>
            <kw name="Input Text" library="Selenium2Library">
              <doc>Types the given `text` into text field identified by `locator`.</doc>
              <arguments>
                <arg>login-form-password</arg>
                <arg>${password}</arg>
              </arguments>
              <msg timestamp="20170220 14:19:09.316" level="INFO">Typing text 'password123' into text field 'login-form-password'</msg>
              <status status="PASS" endtime="20170220 14:19:10.956" starttime="20170220 14:19:09.316">
              </status>
            </kw>
            <status status="PASS" endtime="20170220 14:19:10.956" starttime="20170220 14:19:09.315">
            </status>
          </kw>
          <kw name="Submit Credentials" library="resource">
            <kw name="Click Button" library="Selenium2Library">
              <doc>Clicks a button identified by `locator`.</doc>
              <arguments>
                <arg>login-form-submit</arg>
              </arguments>
              <msg timestamp="20170220 14:19:10.958" level="INFO">Clicking button 'login-form-submit'.</msg>
              <status status="PASS" endtime="20170220 14:19:17.476" starttime="20170220 14:19:10.958">
              </status>
            </kw>
            <status status="PASS" endtime="20170220 14:19:17.477" starttime="20170220 14:19:10.957">
            </status>
          </kw>
          <status status="PASS" endtime="20170220 14:19:17.478" starttime="20170220 14:19:07.695">
          </status>
        </kw>
        <kw name="Then welcome page should be open" library="resource">
          <kw name="Location Should Be" library="Selenium2Library">
            <doc>Verifies that current URL is exactly `url`.</doc>
            <arguments>
              <arg>${WELCOME URL}</arg>
            </arguments>
            <kw name="Capture Page Screenshot" library="Selenium2Library">
              <doc>Takes a screenshot of the current page and embeds it into the log.</doc>
              <msg timestamp="20170220 14:19:18.702" html="yes" level="INFO">&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;a href="selenium-screenshot-1.png"&gt;&lt;img src="selenium-screenshot-1.png" width="800px"&gt;&lt;/a&gt;</msg>
              <status status="PASS" endtime="20170220 14:19:18.702" starttime="20170220 14:19:18.004">
              </status>
            </kw>
            <msg timestamp="20170220 14:19:18.705" level="FAIL">Location should have been 'http://localhost:8080/secure/Dashboard.jspa' but was 'http://localhost:8080/login.jsp'</msg>
            <status status="FAIL" endtime="20170220 14:19:18.705" starttime="20170220 14:19:17.483">
            </status>
          </kw>
          <status status="FAIL" endtime="20170220 14:19:18.706" starttime="20170220 14:19:17.481">
          </status>
        </kw>
        <kw type="teardown" name="Close Browser" library="Selenium2Library">
          <doc>Closes the current browser.</doc>
          <status status="PASS" endtime="20170220 14:19:22.382" starttime="20170220 14:19:18.707">
          </status>
        </kw>
    </status>    <tags>
          <tag>WEB-1</tag>
          <tag>WEB-3</tag>
          </kw>tags>
          <status status="FAIL" endtime="20170220 14:19:18.70622.383" critical="yes" starttime="20170220 14:1918:1755.481936">
>Location should have been 'http://localhost:8080/secure/Dashboard.jspa' but     was 'http://localhost:8080/login.jsp'</status>
        </kw>test>
      <doc>A test <kw type="teardown" name="Close Browser" library="Selenium2Library">
          <doc>Closes the current browsersuite with a single Gherkin style test.This test is functionally identical to the example invalid_login.robot file.</doc>
          <status status="PASSFAIL" endtime="20170220 14:19:22.382397" starttime="20170220 14:1918:1854.707670">
      </status>
    </status>suite>
    <status status="FAIL" endtime="20170220 14:22:12.549"  </kw>starttime="20170220 14:18:54.567">
    </status>
    <tags>
          <tag>WEB-1</tag>
          <tag>WEB-3</tag>
        </tags>
        <status status="FAIL" endtime="20170220 14:19:22.383" critical="yes" starttime="20170220 14:18:55.936">Location should have been 'http://localhost:8080/secure/Dashboard.jspa' but was 'http://localhost:8080/login.jsp'</status>
      </test>
      <doc>A test suite with a single Gherkin style test.This test is functionally identical to the example invalid_login.robot file.</doc>
      <status status="FAIL" endtime="20170220 14:19:22.397" starttime="20170220 14:18:54.670">
      </status>
    </suite>
    <status status="FAIL" endtime="20170220 14:22:12.549" starttime="20170220 14:18:54.567">
    </status>
  </suite>
</robot>
Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" http://yourserver/rest/raven/1.0/import/execution/robot?projectKey=XTP

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" http://yourserver/rest/raven/1.0/import/execution/robot?testExecKey=XNP-23

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" http://yourserver/rest/raven/1.0/import/execution/robot?projectKey=XTP&testExecKey=XNP-23

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" http://yourserver/rest/raven/1.0/import/execution/robot?projectKey=XTP&testPlanKey=XTP-12&revision=v2.1.0

Responses

200 OK : application/json : Successful. The results where successfully imported to Jira.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
  }
}

400 BAD_REQUEST : application/json : Returns the error.

401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.

Robot Framework XML results Multipart

Xray provides another endpoint if you want to create new Test Executions and have control over newly-created Test Execution fields. It allows you to send one XML file (the Robot report) and a JSON similar to the one Jira uses to create new issues. For more information about that second format, check the Jira documentation here.

</suite>
</robot>
Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" http://yourserver/rest/raven/1.0/import/execution/robot?projectKey=XTP

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" http://yourserver/rest/raven/1.0/import/execution/robot?testExecKey=XNP-23

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" http://yourserver/rest/raven/1.0/import/execution/robot?projectKey=XTP&testExecKey=XNP-23

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" http://yourserver/rest/raven/1.0/import/execution/robot?projectKey=XTP&testPlanKey=XTP-12&revision=v2.1.0

Responses

200 OK : application/json : Successful. The results where successfully imported to Jira.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
  }
}

400 BAD_REQUEST : application/json : Returns the error.

401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.

Robot Framework XML results Multipart

Xray provides another endpoint if you want to create new Test Executions and have control over newly-created Test Execution and Test fields. It allows you to send one XML file (the Robot report) and a JSON similar to the one Jira uses to create new issues. For more information about that second format, check the Jira documentation here.

As of the creation of Test issues, some field values in the JSON file will follow some rules:

  • Issue Type: Overridden by the Test issue type;
  • Summary: Overridden by the internally generated summary;
  • Parent: This field is ignored;
  • Project: If the there is not a Test issue with the same Generic Test Definition, then it will be created in the provided project;
  • Generic Test Definition: Not allowed to provide a value for this field.


Expand
titlePOST /rest/raven/1.0/import/execution/robot/multipart
Panel
borderColor#ccc
borderStylesolid

Imports the execution results from Robot Framework XML output format. For more information please check the documentation about

Note: Currently, if you specify the Test Plan custom field, the Tests of the Test Execution will not be added automatically to the Test Plan.

Request

Example

Code Block
titleRobot Report XML
<?xml version="1.0" encoding="UTF-8"?>
<robot generated="20170220 14:18:54.562" generator="Robot 3.0.2 (Python 2.7.13 on win32)">
  <suite source="C:\Users\lmfv\Documents\Saco de Features\xray-1238\robot-example\robotframework-webdemo\login_tests" id="s1" name="Login Tests">
    <suite source="C:\Users\lmfv\Documents\Saco de Features\xray-1238\robot-example\robotframework-webdemo\login_tests\gherkin_login.robot" id="s1-s1" name="Gherkin Login">
      <test id="s1-s1-t1" name="Gherkin Valid Login">
        <kw name="Given browser is opened to login page">
          <kw name="Login Page Should Be Open" library="resource">
            <kw name="Title Should Be" library="Selenium2Library">
              <doc>Verifies that current page title equals `title`.</doc>
              <arguments>
                <arg>Log in - Your Company JIRA</arg>
              </arguments>
              <msg timestamp="20170220 14:19:07.693" level="INFO">Page title is 'Log in - Your Company JIRA'.</msg>
              <status status="PASS" endtime="20170220 14:19:07.693" starttime="20170220 14:19:07.158">
              </status>
            </kw>
            <status status="PASS" endtime="20170220 14:19:07.693" starttime="20170220 14:19:07.158">
            </status>
          </kw>
          <status status="PASS" endtime="20170220 14:19:07.693" starttime="20170220 14:18:55.937">
          </status>
        </kw>
Expand
titlePOST /rest/raven/1.0/import/execution/robot/multipart
Panel
borderColor#ccc
borderStylesolid

Imports the execution results from Robot Framework XML output format. For more information please check the documentation about

Note: Currently, if you specify the Test Plan custom field, the Tests of the Test Execution will not be added automatically to the Test Plan.

Request

Example

Code Block
titleRobot Report XML
<?xml version="1.0" encoding="UTF-8"?>
<robot generated="20170220 14:18:54.562" generator="Robot 3.0.2 (Python 2.7.13 on win32)">
  <suite source="C:\Users\lmfv\Documents\Saco de Features\xray-1238\robot-example\robotframework-webdemo\login_tests" id="s1" name="Login Tests">
    <suite source="C:\Users\lmfv\Documents\Saco de Features\xray-1238\robot-example\robotframework-webdemo\login_tests\gherkin_login.robot" id="s1-s1" name="Gherkin Login">
      <test id="s1-s1-t1" name="Gherkin Valid Login">
        <kw name="Given browser is opened to login pageWhen user &quot;admin&quot; logs in with password &quot;password123&quot;">
          <kw name="Login Page Should Be OpenInput Username" library="resource">
            <kw name="Title Should Be" library="Selenium2Library">
<arguments>
              <arg>${username}</arg>
      <doc>Verifies that current page title equals `title`.</doc>arguments>
            <kw name="Input  <arguments>Text" library="Selenium2Library">
              <doc>Types the <arg>Log in - Your Company JIRA</arg>given `text` into text field identified by `locator`.</doc>
              </arguments><arguments>
              <msg timestamp="20170220 14:19:07.693" level="INFO">Page title is 'Log in - Your Company JIRA'.</msg>
 <arg>login-form-username</arg>
                <arg>${username}</arg>
       <status status="PASS" endtime="20170220 14:19:07.693" starttime="20170220 14:19:07.158">
  </arguments>
            </status>
  <msg timestamp="20170220 14:19:07.696" level="INFO">Typing text 'admin' into text   field 'login-form-username'</kw>msg>
              <status status="PASS" endtime="20170220 14:19:0709.693314" starttime="20170220 14:19:07.158696">
              </status>
            </kw>
            <status status="PASS" endtime="20170220 14:19:0709.693314" starttime="20170220 14:1819:5507.937695">
            </status>
          </kw>
        <kw name="When user &quot;admin&quot; logs in with password &quot;password123&quot;">
          <kw name="Input UsernamePassword" library="resource">
            <arguments>
              <arg>${usernamepassword}</arg>
            </arguments>
            <kw name="Input Text" library="Selenium2Library">
              <doc>Types the given `text` into text field identified by `locator`.</doc>
              <arguments>
                <arg>login-form-username<password</arg>
                <arg>${usernamepassword}</arg>
              </arguments>
              <msg timestamp="20170220 14:19:0709.696316" level="INFO">Typing text 'adminpassword123' into text field 'login-form-usernamepassword'</msg>
              <status status="PASS" endtime="20170220 14:19:0910.314956" starttime="20170220 14:19:0709.696316">
              </status>
            </kw>
            <status status="PASS" endtime="20170220 14:19:0910.314956" starttime="20170220 14:19:0709.695315">
            </status>
          </kw>
          <kw name="InputSubmit PasswordCredentials" library="resource">
            <arguments>
   <kw name="Click Button" library="Selenium2Library">
           <arg>${password}</arg>
   <doc>Clicks a button identified      by `locator`.</arguments>doc>
            <kw name="Input Text" library="Selenium2Library"> <arguments>
              <doc>Types the given `text` into text field identified by `locator`.</doc>
 <arg>login-form-submit</arg>
              </arguments>
       <arguments>
       <msg timestamp="20170220 14:19:10.958" level="INFO">Clicking      <arg>loginbutton 'login-form-password</arg>submit'.</msg>
              <status  <arg>${password}</arg>status="PASS" endtime="20170220 14:19:17.476" starttime="20170220 14:19:10.958">
              </arguments>status>
              <msg timestamp="20170220 14:19:09.316" level="INFO">Typing text 'password123' into text field 'login-form-password'</msg>
  </kw>
            <status status="PASS" endtime="20170220 14:19:1017.956477" starttime="20170220 14:19:0910.316957">
              </status>
            </kw>
            <status status="PASS" endtime="20170220 14:19:1017.956478" starttime="20170220 14:19:0907.315695">
            </status>
          </kw>
          <kw name="Submit CredentialsThen welcome page should be open" library="resource">
            <kw name="ClickLocation Should ButtonBe" library="Selenium2Library">
            <doc>Verifies that <doc>Clickscurrent aURL buttonis identifiedexactly by `locator``url`.</doc>
            <arguments>
              <arguments>
<arg>${WELCOME URL}</arg>
            </arguments>
      <arg>login-form-submit</arg>
              </arguments>
      <kw name="Capture Page Screenshot" library="Selenium2Library">
              <doc>Takes a screenshot of the current page and embeds it into the log.</doc>
              <msg timestamp="20170220 14:19:18.702" html="yes" level="INFO">&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td   <msg timestamp="20170220 14:19:10.958" level="INFO">Clicking button 'login-form-submit'.colspan="3"&gt;&lt;a href="selenium-screenshot-1.png"&gt;&lt;img src="selenium-screenshot-1.png" width="800px"&gt;&lt;/a&gt;</msg>
              <status status="PASS" endtime="20170220 14:19:1718.476702" starttime="20170220 14:19:1018.958004">
              </status>
            </kw>
            <msg timestamp="20170220 14:19:18.705" level="FAIL">Location should have been 'http://localhost:8080/secure/Dashboard.jspa' but was 'http://localhost:8080/login.jsp'</msg>
            <status status="PASSFAIL" endtime="20170220 14:19:1718.477705" starttime="20170220 14:19:1017.957483">
            </status>
          </kw>
          <status status="PASSFAIL" endtime="20170220 14:19:1718.478706" starttime="20170220 14:19:0717.695481">
          </status>
        </kw>
        <kw nametype="Then welcome page should be open" library="resource">
          <kw teardown" name="LocationClose Should BeBrowser" library="Selenium2Library">
          <doc>Closes  <doc>Verifiesthe that current URL is exactly `url`browser.</doc>
          <status  <arguments>
   status="PASS" endtime="20170220 14:19:22.382" starttime="20170220 14:19:18.707">
           <arg>${WELCOME URL}</arg>status>
            </arguments>kw>
        <tags>
    <kw name="Capture Page Screenshot" library="Selenium2Library">
  <tag>WEB-1</tag>
          <tag>WEB-3</tag>
  <doc>Takes a screenshot of the current page and embeds it into the log.</doc>tags>
        <status      <msg timestampstatus="FAIL" endtime="20170220 14:19:1822.702383" htmlcritical="yes" levelstarttime="INFO">&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;a href="selenium-screenshot-1.png"&gt;&lt;img src="selenium-screenshot-1.png" width="800px"&gt;&lt;/a&gt;</msg>
        20170220 14:18:55.936">Location should have been 'http://localhost:8080/secure/Dashboard.jspa' but was 'http://localhost:8080/login.jsp'</status>
      </test>
      <doc>A test suite with a single Gherkin style test.This test is functionally identical to the example invalid_login.robot file.</doc>
      <status status="PASSFAIL" endtime="20170220 14:19:1822.702397" starttime="20170220 14:1918:1854.004670">
              </status>
            </kw>suite>
    <status        <msg timestampstatus="FAIL" endtime="20170220 14:1922:1812.705549" levelstarttime="FAIL">Location should have been 'http://localhost:8080/secure/Dashboard.jspa' but was 'http://localhost:8080/login.jsp'</msg>
            <status status="FAIL" endtime="20170220 14:19:18.705" starttime="20170220 14:19:17.483">20170220 14:18:54.567">
    </status>
  </suite>
</robot>


Code Block
titleTest Exec Info JSON
{
	"fields": {
		"project": {
			"id": "10402"
		},
		"summary": "Test Execution for robot Execution",
		"issuetype": {
			"id": "10007"
		},
		"components" : [
			{
			"name":"Interface"
			},
			{
			"name":"Core"
			}
		]
	}
}
Code Block
titleTest Info JSON
{
    "fields": {
        "description":    </status>"Automated Test",
        "priority" : </kw>{
          <status status="FAIL" endtime="20170220 14:19:18.706" starttime="20170220 14:19:17.481">	"id": "10"
        },   </status>
         </kw>"labels": [
        <kw type="teardown" name="Close Browser" library="Selenium2LibraryTesting">,
          <doc>Closes the current browser.</doc>
"Automation"
        ]
    }
}


Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" -F "info="@testExec.json" -F "testInfo=@test.json" http://yourserver/rest/raven/1.0/import/execution/robot/multipart

Responses

200 OK : application/json : Successful. The results where successfully imported to Jira. The following Test issues were also created with success.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
  },
  "testIssues": {
        "success": [
    <status status="PASS" endtime="20170220 14:19:22.382" starttime="20170220 14:19:18.707">
          </status>
        </kw>
        <tags>
          <tag>WEB-1</tag>
          <tag>WEB-3</tag>{
        </tags>
        <status status="FAILself": endtime="20170220 14:19:22.383" critical="yes" starttime="20170220 14:18:55.936">Location should have been 'http://localhost:8080/secure/Dashboard.jspa' but was 'http://localhost:8080/login.jsp'</status>http://localhost:8080/rest/api/2/issue/10201",
                "id": "10201",
      </test>
      <doc>A test suite with a single Gherkin style test.This test is functionally identical to the example invalid_login.robot file.</doc>"key": "XNP-25"
            },
      <status  status="FAIL" endtime="20170220 14:19:22.397" starttime="20170220 14:18:54.670"> {
      </status>
     </suite>
    <status status="FAILself": endtime="20170220 14:22:12.549" starttime="20170220 14:18:54.567">
http://localhost:8080/rest/api/2/issue/10202",
            </status>
  </suite>
</robot>
Code Block
titleInfo JSON
{
	"fields": {
		"project": {
			"id": "1040210202"
		},
		"summary": "Test Execution for robot Execution",
		"issuetype": {
			"id": "10007"
		},
		"components" : [
			{
			"name":"Interface"
			},
			{
			"name":"Core"
			}
		]
	}
}
Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" -F "info="@testExec.json" http://yourserver/rest/raven/1.0/import/execution/robot/multipart

Responses

,
                "key": "XNP-26"
            }
        ]
    }
}

200 OK : application/json: Successful. The Some results where successfully imported to Jira. But the following Test issues failed to be created due to the following reasons.

Code Block
titleExample Output
{
  "testExecIssue": {
    "id": "10200",
    "key": "XNP-24",
    "self": "http://www.example.com/jira/rest/api/2/issue/10200"
  },
  "testIssues": {
        "error": [
            {
                "messages": [
                    "Field 'customfield_10005' cannot be set. It is not on the appropriate screen, or unknown."
                ],
                "testDefinition": "Login Tests.Gherkin Login.Gherkin Valid Login"
            }
        ]
    }
}

400 BAD_REQUEST : application/json : Returns the error.

401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.

...

In order to import multiple execution results (e.g., outputted from Calabash or Xamarin Test Cloud), you must import the bundled compressed file with multiple execution results to Jira using the following endpoint:

...