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

Last updated: Jul 12, 2017 11:59

Code Snippet - Selenium: Retrieve the test report URL, device id, and execution id


When using Selenium or Appium, it is possible to retrieve information from the driver that allows access to the Perfecto Reports. The driver capabilities provide information that is useful in retrieving the execution report for your test script.


Use the Selenium getCapabilities() method to retrieve the full capabilities associated with your automation driver and use the following capabilities to access the report related information:


testGridReportUrlReturns the URL to access the Reporting Library Grid for this execution
reportPdfUrlReturns the URL to download a PDF formatted copy of the Execution Test Summary Report
reportKeyFor users still using the legacy Perfecto report - the Perfecto Lab key used to access the legacy report.
executionIdThe Perfecto Lab identifier for the current execution. May be used to identify the report in the Report Grid.
deviceNameThe name of the device used in this test execution.


The following snippet shows how to retrieve the URL of the Execution Test Report and the Execution identifier.

Capabilities capabilities = driver.getCapabilities();
String executionId = (String) capabilities.getCapability("executionId");
String repURL = (String) capabilities.getCapability("testGridReportUrl");