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.
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.
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.
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.
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.
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.