Needed for when someone wants to create automation via eclipse
Step-by-step guide
Selenium setup
- Download the Selenium Java Client Driver(http://docs.seleniumhq.org/download/)
Download latest Java version.
- Create a new folder with name say ‘Selenium’ in C drive and extract the jar files to ‘Selenium’ folder.
Jars to copy, copy the one in the default folder and then all the jars in the lib folder: (note versions might be different)
Cucumber setup:
- Download Cucumber jar files (https://mvnrepository.com/search?q=cucumber)
Jars to download:
Cucumber Core
https://mvnrepository.com/artifact/info.cukes/cucumber-core
Cucumber HTML
https://mvnrepository.com/artifact/info.cukes/cucumber-html
Cucumber JVM: Java
https://mvnrepository.com/artifact/info.cukes/cucumber-java
Cucumber JVM: Java8
https://mvnrepository.com/artifact/info.cukes/cucumber-java8
Cucumber JVM: JUnit
https://mvnrepository.com/artifact/info.cukes/cucumber-junit
Cucumber JVM: PicoContainer
https://mvnrepository.com/artifact/info.cukes/cucumber-picocontainer
Cucumber Report Generator
https://mvnrepository.com/artifact/com.github.mkolisnyk/cucumber-report-generator
Gherkin
https://mvnrepository.com/artifact/info.cukes/gherkin
Gherkin Repackaged Dependencies
https://mvnrepository.com/artifact/info.cukes/gherkin-jvm-deps
-
Create a new folder with name say Cucumber in C drive and extract the jar files to Cucumber folder.
Eclipse setup:
- In eclipse:
– Now Right-click on <project name> and select Properties.
– On the Properties window, click on “Java Build Path”.
– Click on the Libraries tab, and then click “Add External JARs..”
– Navigate to C:\selenium
– Add all the JAR files inside and outside the “libs” folder.
– Navigate to C:\cucumber
– Add all the JAR files inside
– Finally, click OK and we have completed importing Selenium and Cucumber libraries into our project.
Maven setup in Eclipse:
- File > New > ProjectSearch for Maven and select Maven Project
Hit next, next, next
Group Id: com.cucumber
Artifact Id: MavenCucumber
Package: com.cucumber.maven
Update pom.xml file:
project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd“>
<modelVersion>4.0.0</modelVersion><groupId>com.cucumber</groupId>
<artifactId>MavenBillFinRegressionSuite</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging><name>MavenBillFinRegressionSuite</name>
<url>http://maven.apache.org</url><properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties><dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.mkolisnyk</groupId>
<artifactId>cucumber-reports</artifactId>
<version>1.0.7</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>3.4.0</version>
</dependency>
</dependencies>
</project>