Cucumber In Eclipse

In order to plugin cucumber with eclipse, use the following steps: Step 1 In a first step, make sure the availability of good Internet connection. Now, launch the Eclipse IDE then go to Help menu, and click ' Install New Software '. Cucumber Setup In Eclipse. Next step after this would be to install a plugin in Eclipse to support Gherkin language. This plugin is called Natural. How To Download Natural plugin In Eclipse. Head to top menu in Eclipse and click on Help Eclipse Marketplace. Type Natural in. Launch Eclipse and navigate to 'Help-Install New Software'. Click on 'Add' button Enter any name e.g. 'Cucumber' and type ' ' as location.

In the previous tutorials, we have discussed about BDD (Behavior Driven Development) and Gherkin. Cucumber is one such open source tool, which supports Behavior Driven Development (BDD). In simple words, Cucumber can defined as a testing framework, driven by plain English. It serves as documentation, automated tests, and a development aid – all in one.

  • #1) Eclipse Cucumber Plugin: It helps the Eclipse to understand the Gherkin syntax and highlights the syntax of the feature file instead of a plain text. We need to go to Eclipse Help Install new software Click on Add button Specify the location as this.
  • Install the Cucumber Plugin into Eclipse: This plug in enables certain features in Eclipse – e.g. A nice green cucumber icon for feature files. Also when you double click on a feature file then it will open the feature in Eclipse rather than opening notepad. In Eclipse, go to help-install new software.

Cucumber Project In Eclipse

In this tutorial, we will setup Cucumber with Eclipse.

Prerequisites for Environment Setup for Cucumber

1. Download and Install Java

Java is a robust programming language. Java is a general-purpose programming language that is concurrent; class based and object oriented language. Java follows the concept of “write once and run anywhere (WORA) which means that compiled java code can be run on all different platforms that support java without the need of recompilation. Cucumber supports Java platform for the execution. Click here to know How to install Java

2. Download and Start Eclipse

Cucumber Installation In Eclipse

Eclipse is an Integrated Development Environment (IDE). It contains a base workspace and an extensible plug-in system for customizing the environment. Click here to know How to install Eclipse

3. Maven – How to install Maven on Windows

Apache Maven is a software project management and comprehension tool. It uses the concept of a project object model (POM), Maven can manage a project’s build, reporting and documentation from a central piece of information. MAVEN helps us in creating the project structure, managing and downloading the dependencies. We need to define the required dependencies in pom.xml. Click here to know How to install Maven

4. Configure Cucumber with Maven
Step 1 – Create a Maven Project. Click here to know How to create a Maven project
Step 2 – Open pom.xml of the project
1.Go to package explorer on the left hand side of Eclipse.
2. Expand the project CucumberTest.
3. Locate pom.xml file
4. Add dependencies to POM.XML
Step 3 − Add dependency for selenium:

This will indicate Maven that Selenium jar files are to download from the central repository to the local repository.

3.1 Open pom.xml is in the edit mode, create dependencies tag (), inside the project tag.

3.2 Inside the dependencies tag, create dependency tag ().

Step 4 – Add dependency for Cucumber-Java

This will indicate Maven, which Cucumber files are to be downloaded from the central repository to the local repository. Create one more dependency tag.

Step 5 – Add dependency for Cucumber-JUnit

This will indicate Maven, which Cucumber JUnit files are to download from the central repository to the local repository. Create one more dependency tag.

Install Cucumber In Eclipse

Step 6 – Add dependency for JUnit

This will indicate Maven, which JUnit files are to be downloaded from the central repository to the local repository. Create one more dependency tag. Star plus serial kayamath.

Below is the screenshot which shows that Maven Project called CucumberDemo

Cucumber

This is the image of pom.xml created

Cucumber Setup In Eclipse With Maven

After adding the above mention dependencies, pom.xml looks like the image below

After adding the dependencies and then build the project, below image shows the entire jar files added to the Maven Dependency.