How to configure Eclipse with Cucumber tool for Selenium project?

In the previous tutorial, we discussed various aspects of the Cucumber BDD tool like its introduction, significances, and much more. Basically, our last tutorial has the answer to many questions related to Cucumber. In a Nutshell, Cucumber tool has the solution to all the Agile problems. Now agenda of this tutorial is about discussing the installation steps of Cucumber tool in Eclipse IDE to implement Behaviour Driven Testing in your Selenium project.

Before we discuss the installation steps of Cucumber with Eclipse, I would like to suggest you some interesting articles. You can skip them if you already have the knowledge. Here is the list of articles:

We run cucumber feature file either through command line interface (CLI) or IDE.

Pre-requisites to install Cucumber in Eclipse

Some of the pre-requisites to install Cucumber tool are as follows:

  • A system should be configured with JDK
  • Required JAR file should be downloaded

Steps to install Cucumber tool with IDE

Let’s discuss important steps to install the cucumber tool in the Eclipse IDE.

Step# 1: Download required JAR files

There are some JAR files which you need to download from Maven Repository for a proper functioning of the Cucumber tool. Those JAR files are listed as below:

  • Cucumber-core
  • Cobertura code coverage
  • Cucumber-java
  • Hemcrest core
  • Cucumber-html
  • Gherkin
  • Cucumber-junit
  • Junit
  • Cucumber-reporting
  • TestNG
  • Cucumber-jvm-deeps

You need to visit the Maven Repository page and you have to find each jar file through the search box. Click here to navigate to the Maven repository page.

Maven Repository for Cucumber tool Jar file

Note: When you download the JAR file, make sure that those JAR files are uploaded by info.cukes and those are having the latest version.

Step# 2: Create a project in Eclipse

Now create a Java project in Eclipse.

Follow the path: File->New->Project->Java Project

Java project

Enter the name of the project then click Next.

Step# 3: Add Cucumber JARs to the project

When you click Next in the previous step then Java Settings window pops up. Click on Libraries here then click on Add External JARs.

Add External JARs


Add all your downloaded Cucumber JAR files then click Finish.

Step# 4: Install Cucumber Eclipse plugin in IDE

You have already created a project having Cucumber JAR files. Now install Cucumber eclipse plugin to create feature files.

Go to Help-> Eclipse Marketplace then type Cucumber Eclipse in the search box then click Go.

Cucumber eclipse plugin marketplace

Select Install and follow below screenshots for further installation then click Finish.

Review License Cucumber tool


Step# 5: Create Cucumber Feature File

Create a new folder in your project which will carry all your feature file.

Create folder


Feature Folder Cucumber tool

Next, create your first feature file.

Cucumber feature file

Sample Cucumber Feature File

Below feature file is the first cucumber feature file you get after the first installation.

Project hierarchy based on Cucumber tool

How to configure Cucumber tool with Maven?

This is the alternative to adding the JAR file to the Selenium project. Instead of adding Cucumber JAR files you just need to create dependencies in the pom.xml file. Here are the dependencies:

This was all about configuration of Cucumber tool with Eclipse IDE. You can ask your doubts by using below comment form.

Join Inviul fb group

Leave a Reply