REST interfaces for test automation

Test Automation REST API endpoints allow the following operations on test automation data:

  • Create a test run.
  • Read a test run with its test results. Various filters can be applied.
  • Update a test run state, such as finish, invalidate, or mark as failed.
  • Add test results to an external test run.

GET Test runs

Lists all the tests runs of the specified System Profile, which match filer criteria.

GET
https://<server>:8021/api/v3/profiles/<profileid>/testruns
produces application/json

POST Test run

Creates test run with specified parameters. The response provides the details of the test run.

Some important notes:

  • category is limited to one of the following values:
    • unit (default).
    • uidriven.
    • performance.
    • webapi.
    • external.
  • marker is a label used in the Test Automation dashlet charts.
  • if the platform is left blank, the Agent will detect it automatically.
  • if the includedMetrics is provided, only test results for these metrics will be collected in this test run. In order to collect all test results for a given metric group you can pass just the group name or leave the metric name blank.
  • additionalMetaData can be used to provide additional data stored in Test Run, like Jenkins build ID, list of commiters, etc.
POST
https://<server>:8021/api/v3/profiles/<profileid>/testruns
consumes application/json
produces application/json

POST Test runs search

Searches for a particular test run by specified criteria.

POST
https://<server>:8021/api/v3/profiles/<profileid>/testruns/search
consumes application/json
produces application/json

GET Test run

Inquires details for the specified test run.

GET
https://<server>:8021/api/v3/profiles/<profileid>/testruns/<testrun>
produces application/json

POST Test run results

Posts a test result for a specified test run of the external category.

POST
https://<server>:8021/api/v3/profiles/<profileid>/testruns/<testrun>
consumes application/json

POST Test run finish

Marks specified test run as finished. Response body provides details of the test run.

POST
https://<server>:8021/api/v3/profiles/<profileid>/testruns/<testrun>/finish
produces application/json

POST Test run invalidate

Marks the specified test run as invalid. Response body provides details of the test run.

Sets the test run state to INVALIDATED either for all test executions within that test run, or only executions of tests that matches 'testId' (which can be package, or class or a single test). Returns all test run details (including test executions) of an invalidated test run.

POST
https://<server>:8021/api/v3/profiles/<profileid>/testruns
produces application/json

POST Test run mark as failed

Mark specified test run as failed. The response body contains details about test run.

Note

This request works for Web API Tests and Browser/UI-Driven Tests only.

POST
https://<server>:8021/api/v3/profiles/<profileid>/testruns/<testrun>/markasfailed
produces application/json