JUnit XML Format

You may upload results data to Tesults using a JUnit format XML file.

Tesults recommends using the Tesults API library for your language or test framework plugin instead

A Tesults API library or test framework plugin provides greater control and is the only way to upload files (logs, screenshots etc.) along with your test results.

To upload results using an XML file utilize the /results REST API.

API

https://www.tesults.com/results
Method: 'POST'

Set the content-type header to 'text/xml' and set the target token in the 'Authorization' http header.

Headers

"Content-Type": "text/xml"
"Authorization": "Bearer <token>"

<token> should be replaced with the target token string provided to you on creation of your project. If you did not note down the token when you created your project you can regenerate a token for the target in the configuration menu.

Body

Submit the xml file in the request POST body.

Examples

Example using curl with XML inline as string:

$ curl -X POST -H "Content-Type: text/xml" -H "Authorization: Bearer <token>"
  -d '<?xml version="1.0" encoding="UTF-8"?> <testsuites>...</testsuites>'
  https://www.tesults.com/results

Example using curl with XML file:

$ curl -X POST -H "Content-Type: text/xml" -H "Authorization: Bearer <token>"
  -d @/path/to/junit-results.xml https://www.tesults.com/results

If the the request is successful the response will contain a status code of 200 and include a JSON response as shown below.


status code 200 with JSON response:

{
  "data": {
     "code": 200,
     "message": "Success"
  }
}

If there is an error there will be a status code other than 200 with JSON response as shown:


status code other than 200, for example 400, 401, 403, 429, 500 with JSON response:

{
  "error": {
     "code": 400,
     "message": "Missing required parameters - target and results are required"
  }
}

The error message will provide detail as to the specific reason for the failed request.

Fix the error displayed in the error message and try again to get a successful response.

Your team members will be able to view your uploaded test results immediately after a successful response. Any notificiation recipients you have configured will be notified about the availability of the new results by email.