Last updated: Mar 26, 2019 16:24
Sometimes it is needed to download a Summary PDF report for a Job, which contains tests from more than one driver execution session.
This is possible via the Digital Zoom's API: please see PDF Formatted Report
Step-by-step guide
- Utilize ReportiumExportUtils in your project;
Add following method there:
/** * Downloads the job summary PDF report * * @param jobSummaryPdfPath local path that the downloaded report will be saved to * @param jobName the job name of the report * @param jobNumber the job number of the report * @throws URISyntaxException * @throws IOException */ public static void downloadJobSummaryReport(Path jobSummaryPdfPath, String jobName, String jobNumber) throws URISyntaxException, IOException { System.out.println("Downloading PDF for job: " + jobName + ", # " + jobNumber); URIBuilder uriBuilder = new URIBuilder(REPORTING_SERVER_URL + "/export/api/v1/test-executions/pdf"); uriBuilder.addParameter("jobName[0]", jobName); uriBuilder.addParameter("jobNumber[0]", jobNumber); System.out.println(uriBuilder.build()); downloadPdfFileToFS(jobSummaryPdfPath, uriBuilder.build()); }
Call it in your project as per the example in PdfDownloadCodeSample
//change accordingly or obtain during runtime from test environment String jobName = "<job_name>"; String jobNumber = "<job_number>"; String downloadFolder = "./perfectoReports"; Path jobSummaryPdfPath = Paths.get(downloadFolder, jobName + "_" + jobNumber + ".pdf"); ReportiumExportUtils.downloadJobSummaryReport(jobSummaryPdfPath, jobName, jobNumber);
Related articles
NodeJS: Download Report Summary PDF
PDF Download after Test execution
Python script to download all pdf reports for a particular owner