Table of contents
1.
Introduction to Katalon
2.
Using Test Hooks 
2.1.
Setting Up Cucumber Hooks 
2.1.1.
Creating a Cucumber Feature File 
2.1.2.
Adding Cucumber Hooks
2.2.
 
2.3.
Creating Test Cases with Cucumber Hooks 
3.
Viewing BDD Reports
3.1.
Viewing in Katalon Studio 
3.2.
Viewing in Katalon TestOps
4.
Frequently Asked Questions 
4.1.
What is Katalon Studio?
4.2.
What are Test Hooks in the Cucumber Framework?
4.3.
How can we view BDD reports in katalon?
5.
Conclusion 
Last Updated: Aug 13, 2025

Using Test Hooks for Cucumber Framework and viewing BDD reports in Katalon

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction to Katalon

Katalon is an automating testing software that lets the users test web, mobile or desktop applications and APIs without coding to deliver efficient and robust software to the consumers. The software is built over the Selenium and Appium automation frameworks and makes testing convenient and code-free. 

Using Test Hooks for Cucumber Framework and viewing BDD reports in Katalon

Using Test Hooks 

Katalon Studio lets you use Cucumber test hooks, which work at the start and end of the BDD test. 

Setting Up Cucumber Hooks 

Creating a Cucumber Feature File 

You need to first create a Cucumber feature file to apply hooks. For that:
 

  1. Go to FileNewBDD Feature File.
step1

Ticking the Generate sample Feature template to generate a sample feature file is optional.

2. Go to FileNewGroovy Script to create step definitions. 

step2

 

Adding Cucumber Hooks

  1. We will create a step definition that can include the Cucumber hooks.
adding hooks

 

2. We will now add the cucumber hooks to the new step definition. For instance, to add @Before and @After scenario hooks, use the following script:
 

class SampleTestHook {
    @Before
    public void beforeScenario(Scenario scenario) {
        println 'This is the before scenario method: ' + scenario.getName()
    }


    @After
    public void afterScenario(Scenario scenario) {
        println 'This is the after scenario method: ' + scenario.getName()
    }
}

 

Creating Test Cases with Cucumber Hooks
 

  1. Go to the Manual View of the new test case. Click on the  Add dropdown button and select Cucumber Keywords.
creating test cases with hooks

2. Select the Run Feature File keyword.

step2

3. Now, right-click on the feature file and select Copy ID. This gives the relative path.

step3

4. Doubt-click the Input cell of the Run Feature File keyword. Paste the copied relative path in the previous step here.

step4

5. Now run the test and verify the Cucumber hooks’ message in the Console log:

step5


Viewing BDD Reports

There are two ways to view your BDD reports: in Katalon Studio or Katalon TestOps.

Viewing in Katalon Studio 

There isn’t any custom report for executing feature files. Only generated Cucumber reports for test and test suite collection execution levels are used. 

The generated cucumber reports can be found in the same folder of the Katalon Studio report folder. Go to the Katalon Studio Tests Explorer. Right-click on the desired Report folder. Now choose Open Containing Folder. You will be redirected to the local folder when all the Cucumber Reports are stored.

Katalon supports three formats: JSON, HTML and XML.
 

Viewing in Katalon TestOps

Katalon TestOps supports viewing BDD test results along with advanced analytics like Traceability Matrix Report. 

By default, the BDD test reports are disabled to avoid mixing the BDD and Katalon Studio data formatting. However, it can be manually enabled.
 

Frequently Asked Questions 

What is Katalon Studio?

Katalon is an automating testing software, that lets the users test web, mobile or desktop applications and APIs without coding, to deliver efficient and robust softwares to the consumers.
 

What are Test Hooks in the Cucumber Framework?

Test Hooks work at the start and end of a scenario in a BDD test. Integration of the Cucumber framework in Katalon Studio allows the user to include Cucumber test hooks.
 

How can we view BDD reports in katalon?

There are two ways to view your BDD reports: in Katalon Studio or Katalon TestOps.
 

Conclusion 

In this blog, we learnt how to use Test Hooks in Katalon with the Cucumber framework, with a step-by-step demonstration. We also learnt the ways to view the BDD reports in Katalon. Like and upvote this article if you find its content to be helpful. Additionally, visit our platform Coding Ninjas Studio to read informational articles on important computer fundamentals like DBMSDSACompetitive ProgrammingPythonJava, etc. Happy Coding!!

 

Live masterclass