POST /rest/raven/1.0/import/execution/testng/multipart
Panel
borderColor
#ccc
borderStyle
solid
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
language
xml
title
TestNG 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>
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
title
Example 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": "ut.com.xpanditxpand.ravenjava.service.impl.IssueDataSetTest.testApplyOptions_withNullOptionsAndValidIssue_throwsIllegalArgumentExceptionCalcTest.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.
...
Expand
title
POST /rest/raven/1.0/import/execution/nunit/multipart
Panel
borderColor
#ccc
borderStyle
solid
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.
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
title
Example 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": "utx.com.xpandit.raven.service.impl.IssueDataSetTest.testApplyOptions_withNullOptionsAndValidIssue_throwsIllegalArgumentExceptionCalculatorTests.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
title
POST /rest/raven/1.0/import/execution/robot/multipart
Panel
borderColor
#ccc
borderStyle
solid
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
title
Robot 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 "admin" logs in with password "password123"">
<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"></td></tr><tr><td colspan="3"><a href="selenium-screenshot-1.png"><img src="selenium-screenshot-1.png" width="800px"></a></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>
<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>
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
title
Example 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": "ut.com.xpandit.raven.service.impl.IssueDataSetTest.testApplyOptions_withNullOptionsAndValidIssue_throwsIllegalArgumentExceptionLogin 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.