Cucumber Environment - Cucumber

What is Cucumber Environment?

In this chapter, we will see the environment setup for Cucumber with Selenium WebDriver and Java, on windows machine.

Prerequisites for environment Setup

Following are the prerequisites required to set up with −

Java

Why we want − Java is a strong programming language. Cucumber supports Java platform for the execution.

How to install –

Step 1 − Download jdk and jre from the following link http://www.oracle.com/technetwork/java/javase/downloads/index.html

Step 2 − Accept license agreement.

Step 3 − Install JDK and JRE.

Step 4 − Set the environment variable as shown in the following screenshots.

Cucumber - Environment
Cucumber - Environment

Eclipse

Why we want − Eclipse is an incorporated development environment (IDE). It consists of a base workspace and an extensible plug-in system for customizing the surroundings.

How to install −

Step 1 − Ensure JAVA is mounted for your machine.

Step 2 − Download Eclipse from https://eclipse.org/downloads/

Step 3 − Unzip and Eclipse is installed.

Maven

Why we need − Maven is a build automation tool used generally for Java projects. It gives a commonplace platform to perform sports like generating supply code, compiling code, packaging code to a jar, and so on. Later if any of the software program versions gets modified, Maven presents an clean manner to regulate the check project consequently.

How to install −

Step 1 − Download Maven from the following hyperlink − https://maven.apache.org/download.cgi

Step 2 − Unzip the document and remember the region.

Step 3 − Create surroundings variable MAVEN_HOME as proven inside the following screenshot.
Cucumber - Environment

Step 5 − Download MAVEN plugin from Eclipse.

Step 6 − Open Eclipse.

Step 7 − Go to Help → Eclipse Marketplace → Search Maven → Maven Integration for Eclipse → INSTALL.

Configure Cucumber with Maven

Step 1 − Create a Maven project.

• Go to File → New → Others → Maven → Maven Project → Next.

• Provide group Id (group Id will identify your project uniquely across all projects).

• Provide artifact Id (artifact Id is the name of the jar without version. You can choose any name, which is in lowercase). Click on Finish.

Cucumber - Environment
Step 2 − Open pom.xml.

• Go to package explorer on the left hand side of Eclipse.

• Expand the project Cucumber Test.

• Locate pom.xml file.

• Right-click and select the option, open with “Text Editor”.

Step 3 − Upload dependency for selenium: this will suggest Maven which Selenium jar files are to be downloaded from the primary repository to the neighborhood repository.

• Open pom.xml is inside the edit mode, create dependencies tag (), within the challenge tag.

• Within the dependencies tag, create dependency tag ()

• Provide the following information in the dependency tag.

Step 4 − add dependency for Cucumber-Java: this may indicate Maven, which Cucumber files are to be downloaded from the important repository to the local repository.

• Create one more dependency tag.

• Provide the following records within the dependency tag

Step 5 − add dependency for Cucumber-JUnit: this could indicate Maven, which Cucumber JUnit files are to be downloaded from the imperative repository to the nearby repository.

• Create one extra dependency tag.

• Provide the following information in the dependency tag

Step 6 − Upload dependency for JUnit: this could indicate Maven, which JUnit files are to be downloaded from the important repository to the local repository.

• Create one more dependency tag.

• provide the following information inside the dependency tag.

Step 7 − Verify binaries.

  • Once pom.xml is edited successfully, save it.
  • Go to Project → Clean − It will take a few minutes.

You will be able to see a Maven repository like shown in the following screenshot.
cucumber enivorment

• Create a feature file (to be covered later).
• Create a step definition file (to be covered later).
• Create a JUnit runner to run the test (to be covered later).

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Cucumber Topics