Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

      Code Block
      String externalId = (String) driver.getCapabilities().getCapability("executionId");
      System.out.println("executionId: " + externalId);


      Info
      iconfalse

      Note: You can crosscheck if you have taken the correct ID by opening the report details in the Report Library.

      Expand
      titleClick to view image




    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.


      Expand
      titleClick to view image


  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.

      Expand
      titleClick to view image



    4. Save the file.

      Expand
      titleClick to view image



    5. Open the pdf with your reader of choice:

      Expand
      titleClick to view image


If you need help with any of these steps, contact Perfecto Support.

Also in this section

Children Display

Related articles

...