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

Last updated: Oct 29, 2019 14:02

by Prasant Sutaria

We can use curl command to execute Digital Zoom API. Following are some sample curl commands:

Download Test Summary Report in PDF formatCurl Command

Perfecto's Digital Zoom API provides option to download Test execution summary in the form of PDF:

MethodAPI
GEThttps://<reporting-server>/export/api/v1/test-executions/pdf?jobName[0]=<JobName>&jobNumber[0]=<JobNumber>

We have to send following header along above request:

Header Parameter NameParameter Value
PERFECTO_AUTHORIZATION<Your personal security token>

Step 1. Construct the API url:

https://<reporting-server>/export/api/v1/test-executions/pdf?jobName[0]=<JobName>&jobNumber[0]=<JobNumber>

Parameter
reporting-server

Reporting server url.

Example: https://demo.reporting.perfectomobile.com

Job NameCI Dashboard Job Name
Job NumberCI Dashboard Job Number

Step 2. Open Terminal/Command prompt.

Step 3. Run following curl command:

Curl Command
curl -g -X GET \
'Reporting API created in step 1'  \
-H 'PERFECTO_AUTHORIZATION: <Security token>'  \
-H 'cache-control: no-cache' -o result.pdf

The above command will generate result.pdf file in current directory.

Get detail about test cases based on driver idCurl Command

Perfecto's Digital Zoom API provides option to get test case details based on filter(s):

MethodAPI
GET

https://<reporting-server>/export/api/v1/test-executions?filters

filters example - jobName[0], jobNumber[0]

For more details - Smart Reporting Public API

We have to send following header along above request:

Header Parameter NameParameter Value
PERFECTO_AUTHORIZATION<Your personal security token>

Step 1. Construct the API url:

https://<reporting-server>/export/api/v1/test-executions?<filter1>[0]=<value>[&<filter2>[0]=<value>]

Step 2. Open Terminal/Command prompt.

Step 3. Run following curl command:

Curl Command
curl -g -X GET \ 'Reporting API created in step 1' \ -H 'PERFECTO_AUTHORIZATION: <Security token>' \ -H 'cache-control: no-cache' > output.txt

The above command will write JSON result in output.txt file in current directory.

How to generate equivalent curl command from PostMan:

In Native app version of postman (I used v6.7.2), we have option to generate code snippets for API request.

  1. Click on code option and it will ask you to select programming language:

2. Select curl from the options provided below.

3. Copy the generated cURL code snippet and paste it on command prompt.

  • No labels