Skip to main content

Extent Reports integration

Extent Reports is a customizable HTML reporting library for Java and .NET that provides 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.

Integrating with Extent Reports allow you to streamline test reporting and enhance visibility from Katalon Studio built-in test reports. These reports are visually appealing and easy to navigate, making it simpler to understand the test outcomes.

This document shows you how to set up and generate Extent Reports after a test suite execution in Katalon Studio.

Install the plugin
  1. Install the Extent Reports plugin from Katalon Store.
  2. After installing successfully, go to Katalon Studio > Profile > Reload Plugins to double-check that the plugin is available.
Create Test Listener: To apply Extent Reports, you need to set up test listeners that initialize and generate Extent Report after each test suite execution.
  1. In Tests Explorer, select Test Listeners > New > New Test Listener.
  2. Give the test listener a name, for example, ExtentReportsListeners, then click OK.
  3. Copy and paste the following code into the test listener script:
    Adjust your test report name in this method: attachEReport'(testSuiteContext, "<Report title>", "<Report name>").
    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 ExtentReportsListeners {

    def sampleBeforeTestSuite(TestSuiteContext testSuiteContext) {
    CustomKeywords.''(testSuiteContext, "Extent Report", "KS QA Test Report")

    def sampleBeforeTestCase(TestCaseContext testCaseContext) {

    def sampleAfterTestCase(TestCaseContext testCaseContext) throws IOException {

    def sampleAfterTestSuite() {
  4. Open your test case, copy and paste the custom keyword(s) under the corresponding test step you want to capture test execution events.
    Currently Katalon Studio supports two custom keyword for Extent Reports:
    • Attach log to the test step: CustomKeywords.''("Add Test Description Here")
    • Take screenshot of the test step: CustomKeywords.''()
  5. Add the test case to a test suite and execute.
  6. After the execution is finished, click Project > Refresh to load the Extent folder in the Tests Explorer.
  7. Open the .html report to view the generated report of your test execution.