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

Last updated: Feb 07, 2019 09:15

by Nato Vasilevski

If you want to be able to automate the process of download a single test report in PDF via REST API and if you have been wondering how to do it, this article is for you. For presentation purposes I have used Postman. Below in this article you can find more useful information in related articles.

Please do not forget to hit the “Like” button if you found what you have been searching for. Thank you in advance!

Step-by-step guide


First you need a <testExecutionId> that is taken from the Execution Driver Report, in the "id" field of the resource

  1. The following HTTP GET command is used to get you the "id":

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

  2. You 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 reporting tool:

  3. Headers

    Add the following header parameters to the request:

    Name

    Value

    PERFECTO_AUTHORIZATION

    <Your personal security token>



  4. Run it and you should receive such result:


With the ID you have obtained you will be able to run the API call

  1. The following HTTP GET command is used to download the Result from a single test execution:

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


  2. Headers

    Add the following header parameters to the request:

    Name

    Value

    PERFECTO_AUTHORIZATION

    <Your personal security token>



  3. Executing the call will provide you with the ability to download the PDF report successfully:


  4. Save:


  5. Open the pdf with your reader of choice:


You are done!


What do you need to do if you spot something is wrong?

You can open a case here ( https://support.perfecto.io )


Happy testing!


https://developers.perfectomobile.com/display/TT/PDF+Download+after+Test+execution

https://developers.perfectomobile.com/display/PD/DigitalZoom+Reporting+Public+API

https://developers.perfectomobile.com/display/PD/API+for+External+Test+Information