Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Configuring Test Cases to create BDD


I am new to TestRail. I am trying to configure test cases template to be able to facilitate BDD style scenarios. The reason for this is so that we would be able to extract the same tests for BDD automation. Requirements are in BDD hence the test cases will be (thinking ahead for easy automation).
At present the Test Case template includes Preconditions, Steps and Expected Results. This wouldn’t be the ideal setup for BDD style scenarios (test cases). Could I know if someone has already configured the test case template to facilitate this and how the results will display? could you please share the config setup/screen shots etc. Any other thoughts? Thanks.


We are setting up our test infrastructure using the python Behave BDD framework. Our manual testers write test cases using their normal process of preconditions, steps, expected results. When the automation team picks up the test case to automate, we add the BDD gherkin to a custom gherkin field at the bottom, and checkmark a custom “Automated” checkbox for that test case. Finally, our automation controller script queries TestRail for all test cases in a specific project, filters out anything that doesn’t have “Automated” ticked, writes the gherkin to a feature file, and runs behave against that file.


Thanks for your postings! To add a few more context details, you can add custom fields as follows:

You can custom fields of several types (e.g. text, dropdown, multi-select, etc.) and almost all customers use custom fields to add a few additional case or result fields.



Thanks for your feedback. Interesting. At the moment we do not have a QA function up and running and I am trying to establish the test management. We have decided BDD for automation. Hence I thought in the long run the efficiency will be more and all will speak the same language, if we wrote the test cases (further drill down the requirements) in gherkin instead of following the normal flow of filling up the preconditions, steps , expected etc. Was interested to know whether anyone using TestRail in this context.


Thanks, will look into customizing the test cases template for the testers to write their test cases in gherkin syntax.


Sounds good! Just let us know in case any questions come up while setting up the custom fields or anything else, we are happy to help.




I fully use TestRail in combination with Cucumber / Java / Selenium.
You can read about it here:

If you have any further questions, feel free to ask.


Great. Thanks Daniel.


Thanks, Daniel!




I’m interested to this…do you have specific way on how to do this?

I am using perforce as my versioning tool.


Nothing too in depth, really. We (manual QA and the automation team) write gherkin into custom gherkin fields in the test cases:

The automation team has created a middleware framework that acts as our test runner. The framework has a layout that Behave expects (feature files in ./features, step definitions in ./features/steps, environment configuration and setup in ./features/ Jenkins jobs invoke the framework, passing in the target project and other configuration parameters (browser to use, user to use, run name, etc).

When the framework spins up, it:

  • Creates a new run in TestRail for the target project
  • Filters for test cases marked as automated
  • For each test case, the framework reads in the gherkin, and writes that to a feature file
  • The framework then invokes Behave, which runs against the feature file, writing results to a JSON formatted results file
  • Finally, the framework parses the results file and records the result (Pass, Fail, Retest) to TestRail


How did you make the text colorful on TestRail text field?


how do you parse the results file to test rail?, please could you give me details.
thank you