Tutorial 1:Cucumber with java maven project

Hi Folks.

From this Blog we will start a series of cucumber BDD tool .Before go through the cucumber We should know how to integrate cucumber with java maven project.

To run Cucumber test with Java, following are the steps.

Step 1. Install Eclipse IDE -Make sure java should already be installed on your machine.

Step 2. Then Create the New Project in Eclipse IDE by following steps:

  • Click on new –> Other –> Maven –> Maven Project — > Next
  • After that click on Simple project and keep the default workspace location
  • Provide details as Artifact id, Group id, name and description. and click on Finish.

Step 3. Then Configure Cucumber with Maven.

  •  Open the pom.xml
  • Add dependency for Cucumber-Java, Cucumber-JUnit pom2

Step 4. Once pom.xml is edited successfully, save it. After adding dependencies of Cucumber, this is how pom.xml should look like:


And then

Go to Project → Clean and build the project , it will take few second .

You will be able to see all the dependencies(jars) under Maven repository.

Step 5. We will create a simple project structure, to keep files at logical places. We need to create few packages,  Please find the below Screenshot for better understanding.

Create feature files in src/test/resources. and then Create corresponding Step definition classes in src/test/java.

Along with we create CucumberTest class (Test Suite) in src/test/java through which we will generate test report. In target folder, We will get our Test Report .


Hope the blog helpful for the first time User.In next we will go through How to write simple test cases in cucumber.

This entry was posted in Scala and tagged , , , , , , , , , , . Bookmark the permalink.

One Response to Tutorial 1:Cucumber with java maven project

  1. Pingback: Introduction on how to write a First Test Script in CUCUMBER | Knoldus

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s