Getting started with Cucumber tool and Environment setup

June 12, 2018

Cucumber is a tool which helps BDD (Behaviour driven development). It is a tool which supports multiple programming language implementations like Java, JS, PHP, Ruby, Python, C# etc.

In this series of cucumber tutorials, we are going to work with Java programming language.

Environment setup of Cucumber tool with Java:

Pre-requisite:

– JDK and JRE installed on the system
– Java path defined in the environment variables
– Eclipse IDE installed on the system

To set up the environment you can go through – Environment setup Java and Creating a project in Maven.

Add Cucumber jar files to the project:

– cucumber-core
– cucumber-java
– cucumber-java-deps
– cucumber-jvm
– Gherkin

Go to Maven Repository website and search for all above jar files and download them.
– https://mvnrepository.com/

Once you download all the jar files include them in your project by – Right-click Project Name >> Build Path >> configure Build path >> Libraries >> Add External Jar >> Navigate to the path where you have kept the jar files >> select all the jar files >> Click Apply >> Click OK.

Add Maven dependencies:

If you are using Maven as build management tool add below dependencies to your pom.xml file.

Installing Cucumber plugin for Eclipse:

This tool is not a mandatory tool but it makes your cucumber code looks good and properly formatted.

Cucumber eclipse plugin helps eclipse to highlight the Gherkin language syntax which makes it easy for the user to work and understand easily.

To install this plugin follow these steps:

Navigate to help of eclipse >> Install New Software >> Click Add >> Enter name – Cucumber and Location – http://cucumber.github.com/cucumber-eclipse/update-site >> Click OK.

Eclipse will search for the plugin >> Once it shows the plugin select the plugin >> click Next multiple times.

Accept the license >> Finish.

If it shows some warning click OK.

The cucumber eclipse Plugin will take some time to install. Restart the eclipse.

Now we are ready to start working with cucumber. In the next tutorial, we will create and run our first test case.

Saurabh Dhingra

About the Author

Saurabh Dhingra

Follow Saurabh Dhingra:

Leave a Comment: