Unified Reporting REST APIs

Starting from HCL OneTest™ Performance 9.2.0.1, the test results can now be accessed using REST APIs. This means that from your tooling environment, you can write a program to access the Unified Reporting APIs to extract the test information that you need. For example, you want to display the latest test results of the daily builds to your customers who do not have direct access. Instead of manually exporting the test results, a program can be deployed at a customer site that accesses test results on a daily basis.

The APIs are in a Swagger format so that you can download the YAML/JSON files and use them with a compatible client. To download the files, type https://myserver:5443/api/docs/?root=/results in the web browser. By default, the files are served in the JSON format. If the HTTP client includes the header "Accept: application/yaml", the YAML file is returned.

To view the APIs, you must have started HCL Quality Server. From the web browser, type https://myserver:5443/api/explorer/?root=/results. For the responses, you can choose whether you need the response in YAML or JSON format.

Starting from 9.2.1.1 release, you can view the Swagger-based API docs by clicking the API from the Unified Reporting web application.

The browser displays the following aspects of Unified Reporting and can be accessed through APIs.

Labels

This option displays the labels or tags that have been applied to the test results. Click Try it out to view the APIs for labels.

Projects

This option has two GET functions - first, to display project details for all the projects available on the server and, second, to display the project details for the specified project ID. To view the project details for the first function, click Try it out. The response includes both the project names and the IDs.

Project Details dialog

To view the project details for a specific project, enter the ID in Parameter and click Try it out.

Reports

This option displays the specific report that is associated with an ID. To view the reports' APIs, enter an ID in Parameter and click Try it out.

Results

This option has two GET functions and one POST function. The functionality is same for all the three functions. The choice between GET and POST depends mainly on the tool that you use to make the calls. The GET function can use a simple command line tool such as Curl. If you have to make the calls from the web application that is written in JavaScript, POST can be used.

The first GET function displays test results' APIs for all the projects on the server or for the particular criteria that you specify in the parameters. For example, if you want to view only the PASS verdicts whose status is COMPLETE, you can select those options in verdict and status parameters and click Try it out.

In the POST function, you can specify the test information that you need in the JSON or YAML format in the body parameter and click Try it out.

The second GET function displays test results APIs for the specific result ID.

Feedback