Download an STR via REST API
If you want to be able to automate the process of downloading a single test report (STR) in PDF format via REST API and if you have been wondering how to do it, this article is for you. For presentation purposes, we have used Postman.
For more information, see the related articles at the end of this page.
Step-by-step instructions
- Retrieve the <testExecutionId> from the Execution Driver Report ("id" field of the resource), as follows:
- The following HTTP GET command is used to get you the "id":
- Add the externalId[0] parameter with a value you can obtain from the testrun itself by using the following line:
Add the following header parameters to the request:
Name
Value
PERFECTO_AUTHORIZATION
<Your personal security token>
- Run the request. You should receive results such as the following.
https://<myCloud>.reporting.perfectomobile.com/export/api/v1/test-executions
CopyString externalId = (String) driver.getCapabilities().getCapability("executionId");
System.out.println("executionId: " + externalId);Note: You can crosscheck if you have taken the correct ID by opening the report details in the Report Library. - With the ID you have obtained, run the API call, as follows:
To download the result from a single test execution, use the following HTTP GET command:
Copyhttps://<myCloud>.reporting.perfectomobile.com/export/api/v1/test-executions/pdf/<testExecutionId>
Add the following header parameters to the request:
Name
Value
PERFECTO_AUTHORIZATION
<Your personal security token>
Execute the call to download the PDF report.
Save the file.
Open the pdf with your reader of choice:
If you need help with any of these steps, contact Perfecto Support.
Also in this section
Related Articles
- PDF download after test execution
- Smart Reporting Public API
- API for external test information
- Upload a file to the Perfecto Repository with secure authentication (FR)
- Upload a file to the TestingCloud Repository with secure authentication
- Download an STR via REST API
- Download crash reports via REST API
- Reboot device through REST API