Skip to main content

Create BDD test cases in Katalon Studio

This section shows you how to create BDD test cases in Katalon Studio.

Include a feature file in test cases

To include a Cucumber feature file in Katalon Studio test case, you can use Cucumber keywords in your test case. Katalon Studio supports Cucumber keywords along with the original built-in keywords. You do not have to import Cucumber libraries into Katalon Studio.

Attention:
  • You can only use custom keywords in your BDD tests when the step definition of the feature file belongs to the default package.
Use casesCucumber keywords
Execute a single Feature File (with or without tags)
Execute multiple Feature Files (with or without tags)
Execute using Cucumber Runner
For example:
CucumberKW.runFeatureFile('Include/features/logIn.feature')

feature file in a test caseAfter you execute your BDD tests, you can view BDD report files generated from Katalon Studio or upload and view reports on Katalon TestOps. See: View BDD reports.

Create BDD test case with Cucumber Hooks

To create a BDD test case with Cucumber Hooks, follow these steps:
  1. Set up Cucumber hooks in Katalon Studio. See: Set up Cucumber hooks.
  2. Create a new test case.
    You can refer to this document: Create a new test case in Katalon Studio.
  3. In the Manual view of the new test case, click on the Add dropdown button and select Cucumber Keywords.
    Add Cucumber Keywords
  4. Select the Run Feature File keyword.
    Select Run Feature File keyword
  5. Right-click on the Feature file and select Copy ID to get the relative path.
  6. Double-click on the Input cell of the Run Feature File keyword. In the displayed Input dialog, paste the copied relative path from step 3 as the input value.
    Input feature file value
  7. Run the test and verify the message of the Cucumber hooks in the Console log:
    Cucumber hooks message
Was this page helpful?