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.

The request produces application/json.

GET
  • AppMon 2017 May https://:8021/api/v2/profiles/{profileid}/testruns
  • AppMon 2018 April https://:8021/api/v3/profiles/{profileid}/testruns
  • AppMon 2018 October https://:8021/api/v4/profiles/{profileid}/testruns

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.

The request consumes and produces application/json

POST
  • AppMon 2017 May https://:8021/api/v2/profiles/{profileid}/testruns
  • AppMon 2018 April https://:8021/api/v3/profiles/{profileid}/testruns
  • AppMon 2018 October https://:8021/api/v4/profiles/{profileid}/testruns

POST Test runs search

Searches for a particular test run by specified criteria.

The request consumes and produces application/json.

POST
  • AppMon 2017 May https://:8021/api/v2/profiles/{profileid}/testruns/search
  • AppMon 2018 April https://:8021/api/v3/profiles/{profileid}/testruns/search
  • AppMon 2018 October https://:8021/api/v4/profiles/{profileid}/testruns/search

GET Test run

Inquires details for the specified test run.

The request produces application/json.

GET
  • AppMon 2017 May https://:8021/api/v2/profiles/{profileid}/testruns/{testrun}
  • AppMon 2018 April https://:8021/api/v3/profiles/{profileid}/testruns/{testrun}
  • AppMon 2018 October https://:8021/api/v4/profiles/{profileid}/testruns/{testrun}

POST Test run results

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

The request consumes application/json.

POST
  • AppMon 2017 May https://:8021/api/v2/profiles/{profileid}/testruns/{testrun}
  • AppMon 2018 April https://:8021/api/v3/profiles/{profileid}/testruns/{testrun}
  • AppMon 2018 October https://:8021/api/v4/profiles/{profileid}/testruns/{testrun}

POST Test run finish

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

The request produces application/json.

POST
  • AppMon 2017 May https://:8021/api/v2/profiles/{profileid}/testruns/{testrun}/finish
  • AppMon 2018 April https://:8021/api/v3/profiles/{profileid}/testruns/{testrun}/finish
  • AppMon 2018 October https://:8021/api/v4/profiles/{profileid}/testruns/{testrun}/finish

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.

The request produces application/json.

POST
  • AppMon 2017 May https://:8021/api/v2/profiles/{profileid}/testruns/{testrun}/invalidate
  • AppMon 2018 April https://:8021/api/v3/profiles/{profileid}/testruns/{testrun}/invalidate
  • AppMon 2018 October https://:8021/api/v4/profiles/{profileid}/testruns/{testrun}/invalidate

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.

The request produces application/json.

POST
  • AppMon 2017 May https://:8021/api/v2/profiles/{profileid}/testruns/{testrun}/markasfailed
  • AppMon 2018 April https://:8021/api/v3/profiles/{profileid}/testruns/{testrun}/markasfailed
  • AppMon 2018 October https://:8021/api/v4/profiles/{profileid}/testruns/{testrun}/markasfailed