Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Aug 09, 2021 16:57


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

  1. Retrieve the <testExecutionId> from the Execution Driver Report ("id" field of the resource), as follows:
    1. The following HTTP GET command is used to get you the "id":

      https://<myCloud>.reporting.perfectomobile.com/export/api/v1/test-executions

    2. Add the externalId[0] parameter with a value you can obtain from the testrun itself by using the following line:

      String 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.

    3. Add the following header parameters to the request:

      Name

      Value

      PERFECTO_AUTHORIZATION

      <Your personal security token>

    4. Run the request. You should receive results such as the following.
  2. With the ID you have obtained, run the API call, as follows:
    1. To download the result from a single test execution, use the following HTTP GET command:

      https://<myCloud>.reporting.perfectomobile.com/export/api/v1/test-executions/pdf/<testExecutionId>


    2. Add the following header parameters to the request:

      Name

      Value

      PERFECTO_AUTHORIZATION

      <Your personal security token>

    3. Execute the call to download the PDF report.

    4. Save the file.


    5. 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