Tags: automation testing beginner tutorials test automation jobs selenium java cucumber bdd tutorials cucumber java selenium tutorials cucumber bdd selenium with java cucumber bdd beginner tutorials how to setup selenium cucumber java project interview questions cucumber bdd
Free Tutorials - https://automationstepbystep.com/
Quiz - https://forms.gle/XZeHkARaRi4K18Wm6
Step 1, create a maven project: 0:00-3:12
Step 2, download maven dependencies: 3:13-6:53
Step 3, create file structure: 6:54-8:19
Step 4, 5, 6, create feature file: 8:20-17:20
Step 7: 17:21-19:19
Step 8, glue code: 19:20-27:38
Step 9, runner class: 27:39
Step 1 - Create a new maven project
Step 2 - Add maven dependencies
Cucumber Java | Cucumber JUnit | JUnit | Selenium Java
Step 3 - Create a folder Features under src/test/resources
Step 4 - Under features folder create a new feature file login.feature
Step 5 - Download cucumber plugin from Eclipse Marketplace
Step 6 - Create feature file and add contents
Feature
Scenario
Steps
Scenario Outline
Example
Tags
Comments
Step 7 - Try to run the feature file
Step 8 - Add Step Definitions / Glue Code under src/test/java package
Step 9 - Create a Runner class
import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(features="src/test/resources/Features",
glue={"StepDefinitions"})
public class TestRunner {
}
monochrome = true
plugin = { "pretty", "html:target/reports"}
plugin = { "pretty", "json:target/reports/cucumber.json"}
plugin = { "pretty", "junit:target/reports/cucumber.xml"}
tags="@smoketest"
Step 10 - Create Add Cucumber Options for generating reports
HTML | JSON | JUNIT/XML
Step 11 - Run and verify results
Never Stop Learning
Raghav Pal
GitHub Repositories
https://github.com/Raghav-Pal/SeleniumCucumberBDD
https://github.com/Raghav-Pal/CucumberBDDCMD
Join this channel to get access to perks: https://www.youtube.com/automationstepbystep/join
Hit Like and. Subscribe button, if you like this video. It gives me great motivation.
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping https://animalaidunlimited.org/ or any animal welfare group near you, in any way you can.
Free courses - https://automationstepbystep.com/online-courses/
Udemy Discounts - https://automationstepbystep.com/udemy-discounts/
Stories - https://automationstepbystep.com/stories/
or
Question
You're amazing simply amazing I never commented on YouTube but this is way too much to just watch the video and leave thank you from Canada!
Hi Raghav.. First of all the tutorial is awesome. Thank you so much for this. I have 1 question to ask. I tried giving the plugin "plugin= {"pretty", "html:target/HtmlReports/report.html"}" - by creating a folder name HTMLReports under targets manually. but the execution is failed telling that already exist. Can you give any suggestion for this.
U the best thank you so much for this tutorials π€©
I Followed the same Process...
If i run the feature y am I Getting as 0 Scenarios and 0 Steps...
Hi Raghav, I am getting this error while executing the cucumber run in login.feature "WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main" Could you please help?
very usefull video sir
Hi Raghav, I would first like to thank your for your all short tutorials on each topics, which are really very helpful. I am getting the error "Mar 06, 2023 11:42:12 AM cucumber.api.cli.Main run
WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main" , I searched on google but not found any solution of it. Please help. Thanks.
Hi Raghav ! Very Good Content on Cucumber, it was very useful to me
Hi Raghav,I am getting this error while running"The type io.cucumber.core.eventbus.UuidGenerator cannot be resolved. It is indirectly referenced from required .class files" Can you please help me on this. Provided JUnit and cucumber Junit dependencies in pom.xml file. Selected cucumber JVM:JUnit4 and JUnit from Maven central.
Awesome π