Create new Cucumber Eclipse project

Create new Cucumber Eclipse project

This is a continuation of our previous article on cucumber, where we provided information on how to download Cucumber and Selenium jar files. In this article, we will go a step forward and show you how to setup a cucumber eclipse project from scratch. We will then also add all these jar files to this cucumber project. Let us now start the process of creating cucumber eclipse project.

Note: This article is a part of our Cucumber Tutorial series. Head over to our Selenium Cucumber Tutorial main page for the step by step cucumber setup guide

Open Eclipse IDE

To start with, please make sure that you have downloaded Eclipse IDE on your machine. If not, you can check out this guide on how to download and setup Eclipse IDE. Follow the steps given below to open Eclipse IDE –

1. Open the path where you have the unzipped Eclipse folder. Double click on eclipse.exe to open it

(adsbygoogle = window.adsbygoogle || []).push({});

Open eclipse.exeOpen eclipse.exe

2. Once Eclipse starts opening, you would see the Eclipse logo

Eclipse IDE starts openingEclipse IDE starts opening

3. Next you would see Workspace Launcher popup box. You can either leave the Workspace location as the default value, or you can browse to any folder path you wish. For this article, we are leaving it as default

Select a Workspace - EclipseSelect a Workspace - Eclipse

4. Click on Ok button. Eclipse would start loading all the files. Once its done, you will see the Eclipse IDE Welcome page as shown below

(adsbygoogle = window.adsbygoogle || []).push({});

Eclipse IDE - Welcome ScreenEclipse IDE - Welcome Screen

Create new Project in Eclipse

Create a new Java project in Eclipse by following the steps given below –

1. Select File -> New -> Project… option from Eclipse IDE

Appium Project : Eclipse - File - New - Project... optionAppium Project : Eclipse - File - New - Project... option

2. In the New Project popup box, select Java Project and then click on Next button

Select Java Project from New Project popupSelect Java Project from New Project popup

3. In the New Java Project popup box, write the project name as CucumberTutorial. Leave all the other fields as default and then click on Finish button

Create new cucumber eclipse projectCreate new cucumber eclipse project

4. If the panel at the left side is collapsed, then you can restore it as shown below

Eclipse - Restore Left PanelEclipse - Restore Left Panel

5. Eclipse IDE would now look like the image shown below. It would display your newly created project in the left side pane. If there are some additional panes on the right side (Tasks List, Welcome screen etc), then you can close those so that Eclipse IDE looks uncluttered

Cucumber project setup in EclipseCucumber project setup in Eclipse

The new Cucumber project is successfully created in Eclipse. Let’s now start with the next section of this article, where we will add all the jar files to this project.

Add Cucumber and Selenium jars to your Eclipse project

In our previous article, we had showed how to download Cucumber and Selenium jar files. Let us now add these jars to our Cucumber Eclipse project by following the steps given below –

1. Right click on the Project. Then select Build Path > Configure Build Path… option

Cucumber eclipse project - configure build pathCucumber eclipse project - configure build path

2. Properties window will now open as shown below. From Libraries tab, click on Add External JARS… button

Libraries tab - click on Add External Jars buttonLibraries tab - click on Add External Jars button

3. Now, navigate to the folder where you have saved Cucumber jars. Select all the jars and then click on Open button

Add cucumber jars to eclipse projectAdd cucumber jars to eclipse project

4. You will now see that all the cucumber related jars are now added to the Libraries tab as shown below

Cucumber jars in Libraries tabCucumber jars in Libraries tab

5. Follow above steps and add Selenium webdriver jars to this project. Make sure that you add client-combined jars, as well as the jars in the lib folder, as shown in the below images

Add client combined jars
Add Selenium JARs to Cucumber ProjectAdd Selenium JARs to Cucumber Project

Add all jars from lib folder
Add Selenium JARs from lib folder to Cucumber projectAdd Selenium JARs from lib folder to Cucumber project

6. Once all the jar files have been added, click on Apply and Close button to close the Properties window. Notice that a new sub-section called Referenced Libraries is created inside the project folder. Expand this Referenced Libraries section. You will see that it lists down all the jar files that you had added in the above steps

Cucumber Tutorial project - Jar files added in Referenced Libraries sectionCucumber Tutorial project - Jar files added in Referenced Libraries section

With this, we now complete our article where we showed how you can create a project for cucumber using Eclipse. In our next article, we will start with the actual cucumber related concepts, starting with the feature file.

Have any doubts or queries about this article? Or do you have any feedback to share with us? You can get in touch with us using the comments section.

Next Article: Add your first Cucumber feature file in the Eclipse project



Leave a Reply

Your email address will not be published. Required fields are marked *