Selenium: BDD Cucumber- Cucumber Options

In last post, we learnt how to write features, scenarios and how to execute BDD cucumber tests. As we are implementing our BDD framework using cucumber, let's explore further about cucumber. We will start with various cucumber options in this post.

We run our cucumber tests from Runner class. You can just go through this once to recapitulate things we discussed in last post Cucumber Demo Test .

In that runner class, we have different cucumber options, it is just like a settings page that how we want to run our tests and different options are also available for that purpose.


[Cucumber Options]



  • Dry Run:  dryrun can be true or false. If dryrun is set true, it will check if the steps written in feature file has corresponding code in step definition file or not. It is good option to catch rudimentary errors. The default value of dryrun is false. You can just try with dryrun=true option to see the result.

  • Monochrome: monochrome option also can take two values, either true or false. If it is set true, we can see much more readable output in console and effective test reports. If is false, console output is not in proper readable format.

  • Features: features option is to locate feature file in our project folder structure. We need to specify only Features folder and it will automatically find file with .feature extension.

  • Glue: It is used to locate the step definition file. While running the scripts, cucumber will find all the associated coding scripts and steps from glue option.

  • Format: format option is used to specify the format we use to generate the output reports. There are various options available for this like pretty, html, json and junit. You can mention like format = {“pretty“} or format = {“html:Folder_Name“} etc. 


We will see more about cucumber BDD framework in coming posts. Cheers !







Comments

More posts on selenium...

Selenium/Java-OOPs-Encapsulation

Selenium/Java-OOPs-Abstraction

Selenium: Automate Web Application Login

Selenium/Java- CoC

Selenium/Java-OOPs-Inheritance

Selenium: Waits

Selenium: All about XPath Locator in WebDriver

Selenium: Capturing the screenshot

Selenium: BDD- The Disruptive Framework

Selenium: Frameworks