In this chapter, we will see the environment setup for Cucumber with Selenium WebDriver and Java, on windows machine.
Following are the prerequisites required to set up with −
Why we want − Java is a strong programming language. Cucumber supports Java platform for the execution.
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.
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.
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.
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.
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.
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.
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.
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.
You will be able to see a Maven repository like shown in the following screenshot.
• 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).
Cucumber Related Interview Questions
|SQL Server 2008 Interview Questions||Agile Testing Interview Questions|
|Selenium Interview Questions||SSIS(SQL Server Integration Services) Interview Questions|
|SSRS(SQL Server Reporting Services) Interview Questions||SQL Server Management Studio Interview Questions|
|Java Interview Questions||Automation Testing Interview Questions|
|JUnit Interview Questions||Cucumber Interview Questions|
|Sql Server Dba Interview Questions||SQL Server Security Interview Questions|
|Agile Methodology Interview Questions|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.