Extent Report Integration

Extent Reports is a customizable HTML reporting library for Java and .NET that provides rich, interactive, and detailed test reports. It offers features such as pie charts, logs, screenshots, and more, making it a popular choice for test reporting in auto

561

Streamline Test Reporting with Extent Reports in Katalon Studio

Introduction:

In today's fast-paced software development landscape, ensuring the quality of applications is paramount. Automated testing has become a cornerstone in achieving this goal, with tools like Katalon Studio empowering teams to automate tests efficiently. However, effective test reporting remains essential for understanding test results and making informed decisions. In this blog post, we'll explore how to leverage Extent Reports within Katalon Studio to streamline test reporting and enhance visibility into test execution results.

What is an Extent Report?

Extent Reports is a customizable HTML reporting library for Java and .NET that provides rich, interactive, and detailed test reports. It offers features such as pie charts, logs, screenshots, and more, making it a popular choice for test reporting in automation frameworks.

Why Use Extent Reports in Katalon Studio?

While Katalon Studio provides built-in test reports, Extent Reports offer several advantages:

  • Interactive Reports: Extent Reports generate interactive HTML reports that provide comprehensive insights into test execution results. These reports are visually appealing and easy to navigate, making it simpler for stakeholders to understand the test outcomes.

  • Customization: Extent Reports allow users to customize the report layout, including logos, colors, and fonts, to align with project branding and preferences. Customization options ensure that the reports meet the specific needs of the project or organization.

  • Rich Features: Extent Reports offer a wide range of features, including charts, tags, test categorization, and attachment support (such as screenshots), enhancing the depth and richness of test reports.

How to Integrate Extent Reports with Katalon Studio?

Integrating Extent Reports with Katalon Studio is straightforward and can be achieved in a few simple steps:

  • Install the Extent Report plugin from Katalon Store. OR Alternatively, download this plugin offline from ChangeLog.

  • Configure Test Listeners: Implement Test Listeners in Katalon Studio to capture test execution events and generate Extent Reports. Test Listeners can be customized to initialize and finalize the Extent Reports instance, as well as log test events such as test start, success, failure, and skipped.

  • Customize Test Case: Enhance the test case customization by incorporating custom functions for capturing screenshots and logging.

  • Generate and View Reports: Execute your automated tests in Katalon Studio, and upon completion, view the generated Extent Reports. These reports can be accessed locally or shared with stakeholders for review and analysis.

Example Code:

Below is a simplified example demonstrating how to integrate Extent Reports with Katalon Studio using Test Listeners:

Test Listeners:

import java.nio.file.Path

import java.nio.file.Paths;

import com.kms.katalon.core.annotation.AfterTestCase

import com.kms.katalon.core.annotation.AfterTestSuite

import com.kms.katalon.core.annotation.BeforeTestCase

import com.kms.katalon.core.annotation.BeforeTestSuite

import com.kms.katalon.core.configuration.RunConfiguration

import com.kms.katalon.core.context.TestCaseContext

import com.kms.katalon.core.context.TestSuiteContext

class ExtentReportsListenres {

@BeforeTestSuite
def sampleBeforeTestSuite(TestSuiteContext testSuiteContext) {
    CustomKeywords.'com.katalon.extent.report.ExtentReport.attachEReport'(testSuiteContext, "Extent Report", "KS QA Test Report")
}


@BeforeTestCase
def sampleBeforeTestCase(TestCaseContext testCaseContext) {

    CustomKeywords.'com.katalon.extent.report.ExtentReport.startEReport'(testCaseContext)
}


@AfterTestCase
def sampleAfterTestCase(TestCaseContext testCaseContext) throws IOException {
    CustomKeywords.'com.katalon.extent.report.ExtentReport.takeScreenshotFailure'(testCaseContext)
}

@AfterTestSuite
def sampleAfterTestSuite() {
    CustomKeywords.'com.katalon.extent.report.ExtentReport.flushEReport'()
}
}

In Test Case:

Call the custom function in test case to attach and take the screenshot.

CustomKeywords.'com.katalon.extent.report.ExtentReport.attachLog'("Add Test Description Here")

CustomKeywords.'com.katalon.extent.report.ExtentReport.addScreenshot'()

Create a test suite or test suite collection and run the test

Verify the test result into the folder "Extent"

Users can refer to Extent Report Form to learn how this plugin can be used with BDD Cucumber for Azure CI/CD.

Key Notes:

  • The Extent Report plugin empowers users to effortlessly generate advanced Extent Reports within Katalon.
  • Empower users to capture screens as needed.
  • Enable users to seamlessly incorporate logs and descriptions into their reports.
  • Facilitate automatic screenshot capture for failed test cases.
  • Automatically capture stack traces for failed scenarios.
  • Offer the functionality to delete existing reports and replace them with updated versions.
  • Enable users to maintain a comprehensive history of all reports.
  • Provide users with the flexibility to customize report names and titles.
  • Enable the generation of test reports in multiple languages with minimal adjustments.
  • Users can use this plugin with CI/CD tools like Jenkins and Azure DevOps to publish their report artifacts.
  • The plugin will generate reports exclusively for test suite and test suite collection executions. However, users retain the capability to execute individual test cases without encountering failures.

Conclusion:

By integrating Extent Reports with Katalon Studio, teams can enhance their test reporting capabilities and gain deeper insights into test execution results. With its interactive and customizable features, Extent Reports empower teams to create informative and visually appealing reports that facilitate better decision-making and collaboration across the project lifecycle. Whether you're a QA engineer, automation tester, or project manager, leveraging Extent Reports in Katalon Studio can significantly improve the effectiveness and efficiency of your test reporting process.

Visit Katalon Forum for Plugin related discussions.

3.7
3 Rating(s)
sesencayi undefined
August 8, 2024

14:34:13.506 [main] ERROR freemarker.runtime - Error executing FreeMarker template freemarker.core._MiscTemplateException: Template inclusion failed (for parameter value "partials/exceptıon.ftl"): Template not found for name "spark/partials/exceptıon.ftl". The name was interpreted by this TemplateLoader: ClassTemplateLoader(resourceLoaderClass=com.aventstack.extentreports.ExtentReports, basePackagePath="templates/" /* relatively to resourceLoaderClass pkg */). ---- FTL stack trace ("~" means nesting-related): - Failed at: #include "partials/${view.toString()}... [in template "spark/spark.spa.ftl" at line 27, column 36] what is this problem???

Keerthana Anbalagan
April 12, 2024

This plugin facilitates understanding the automation test coverage percentage across various instances by utilizing Testing Types tags. It is user-friendly, easy to install, and provides consolidated reports with diverse dimensions such as cross-browser testing and testing across different instances.

mohit.kumar
April 12, 2024

Thank you for utilizing this plugin. We trust that it will be immensely beneficial to you

mohit.kumar
April 12, 2024

The Katalon Extent Report Plugin is a powerful tool that enhances test reporting capabilities within the Katalon Studio automation framework. This plugin offers ease of use and generates user-friendly reports.

This plugin is included in Katalon Studio Enterprise subscription.
API keys are required in Katalon Studio Commandline Execution. Generate Key
Information
Project details
Version
2.8.0
Type
Custom Keywords Plugin
Last updated
November 22, 2024 3:01 am
Publisher
Privacy and License Agreement