Cucumber
​
Introduction To Cucumber & Basics
​
​
First Selenium Test And Mapping In Cucumber
​
​
​
​
​
​
​
​
​
Cucumber Setup In Eclipse
​
​
Steps To Setup Cucumber In Eclipse
​
1. Install Java.
2. Set Environment Variable for JDK .
​
3. Install Maven.
4. Unzip the file at some Location.
5. Set Environment Variable for Maven.
6. Create a Maven Project .
​
7. Download 'Cucumber Eclipse Plugin' from 'Eclipse Marketplace' .
​
8. Add essential dependencies for cucumber in pom.xml:
-
cucumber-java
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>6.10.2</version>
</dependency>
​
-
cucumber-junit
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>6.10.2</version>
</dependency>
​​
​
* If you want to use it with selenium then add selenium dependency :
-
selenium-java
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.0.0</version>
</dependency>
​
​
9. Create a feature file under the project :
​
Right-click on the project and navigate inside New.
​
Click on option Folder and name it as 'Features' .
​
Under this Features folder, create a new .feature file as 'feature.feature' .
​
Write test scenarios here.
​
​
10. Create step-definition file :
​
Create a package under src/main/java named as 'stepdefinitions' :
​
Right-click on this package and navigate through New.
​
Under New, click on Other.. and select Step-Definition class under the option Cucumber.
​
Proeced to Next,enter class name,check the annotations as per requirement and move to Finish .
​
Step-Definition class has been created now.
​
Write test scripts here.
​
​
​
​
Refer next page First Selenium Test And Mapping In Cucumber
​