Skip to main content

Content Starts Here

How to integrate ExtentReports with TestComplete

Overview
How to integrate ExtentReports with TestComplete
Article
It's easy to integrate ExtentReports with TestComplete using JavaBridge. To do this, we'll use the community edition of the ExtentReports library (Java 2.41.2).

After you download the archive, you need to unzip all files from it to a folder and add all .jar files to JavaBridge in TestComplete with the following classes:
User-added image

Then, using the example from the ExtentReports documentation, you can create your own script on JScript:
 
function Test() {
  var extentReports = JavaClasses.com_relevantcodes_extentreports.ExtentReports;
  var logStatus = JavaClasses.com_relevantcodes_extentreports.LogStatus;
  
  var path = ".\\Generated ExtentReport\\report.html"
  
  var extent = extentReports.newInstance(path);
 
  var test = extent.startTest("Sample Test Report", "Sample description");
  
  test.log(logStatus.INFO, "This step shows usage of log INFO");
  test.log(logStatus.PASS, "This step shows usage of log PASS");
  test.log(logStatus.FAIL, "This step shows usage of log FAIL");
  
  extent.endTest(test);
  extent.flush();
}

After running this script, the generated report looks like this:
User-added image

The same sample of how to use the ExtentReports Java module in TestComplete can be downloaded from here.
Previous MonthNext Month
SunMonTueWedThuFriSat