Use the DigitalZoom Reporting HTTP API to retrieve your entire test execution content in JSON format. Two types of test execution data can be retrieved -
Execution Driver Report - presents a list of all executions performed. This report includes links to all artifacts (can be downloaded via the links to them): video, screenshots, device logs, PCAP files, vitals and PDF reports (Summary PDF, Single Test Report PDF).
Single Test Commands Report - presents the test commands of a particular test execution. The test commands are presented according to their execution order and includes the metadata (time and length of execution) for the test execution.
DigitalZoom Reporting API Terminology
Using the DigitalZoom Reporting API requires that you be acquainted with some information:
- CQL_NAME - For example the CQL_NAME=demo
- Reporting Server - Perfecto DigitalZoom Reporting information is stored in a repository on the reporting server. The URI of the reporting server is the same as your Perfecto CQ Lab with ".reporting" appended to the . For example: If you access your Perfecto Lab, located in Germany, using the URL then the corresponding reporting server would be accessed at:
- Driver Execution ID - Each execution has a unique identifier. To obtain the id for a particular execution use the following code sequence in your automation script:
To see the full Java code sample see the export-api-sample in the Perfecto Git repository. Similar samples in other languages can be found in the Reporting-Samples folder (look for the export-api-sample in each language folder) in the Git repository.
Obtain a Personal Security Token
The API requires the use of the Perfecto Security Token. Follow the procedure detailed in the Security Token documentation, before proceeding.
Note: The security token is associated with the specific Perfecto Lab and the personal registered user.
Use the desired API to export data:
The API provides two options for retrieving Report information:
- Retrieve the Execution Driver Report data
- Retrieve the Single Test Report data.
Retrieve the Execution Driver Report
The following HTTP GET command is used to retrieve a list of the test executions in your lab
The following URL query parameters can be added to the URL to filter the number of returned executions.
|startExecutionTime||<Unix time>||The start time, in milliseconds from midnight January 1, 1970 GMT - Epoch/Unix Time|
|endExecutionTime||<Unix time>||The end time, in milliseconds from midnight January 1, 1970 - GMT Epoch/Unix Time|
|externalId||<Driver execution id>||Filter the data to a specific driver execution|
- The endExecutionTime parameter is only relevant if the startExecutionTime is included.
- If using the Epoch Converter tool to generate the Unix time - convert the resulting time to milliseconds by multiplying the result by 1000.
- To programmatically convert human readable dates to Unix time use the information provided at the end of the Epoch Converter page under the heading Convert from human readable date to epoch, but do not divide the result by 1000 to maintain the millisecond Unix time value.
Add the following header parameters to the request:
<Your personal security token>
The following is an example response for test executions -
The information for each test is listed as a "resource". In particular:
- The "id" field below identifies the particular test (the TEST_ID) and can be used to retrieve the Single Test Report for the test.
- The "reportURL" field provides the link to the Single Test Report for the test associated with the "id". The format of the URL is: https://<reporting-server>/test/<TEST_ID>
- Includes information on the device "platform" of the test,
- Provides the Jenkins job-name and build-number of the test.
- The "executionEngine" field provides the Perfecto MCM version used for the execution.
- Provides links to the video segments included for the test.
- Provides links to the artifacts generated for this execution:
- VITALS - links to the vitals report generated if script activates the Start Vitals command.
- NETWORK - links to the pcap file generated for tracking network activity.
- DEVICE_LOGS - links to the logs file generated for the execution.
Retrieve the Single Test Report Data
The following HTTP GET command is used to retrieve the list of commands associated with a single test execution:
The <TEST_ID> is taken from the Execution Driver Report, in the "id" field of the resource. In the example response, above, the <TEST_ID> would be: sklghjfwekrghslkdfghsdjgh
Add the following parameters to the header section of the request:
|PERFECTO_AUTHORIZATION||<Your personal security token>|
The following shows a JSON response for the request to retrieve a STR data: