Selenium Cucumber BDD Framework with Java and TestNG - Login Test
In this video, We will automating a login page of "www.saucedemo...." application using Behavior Driven Development approach(also known as BDD) where in we will be writing login scenario in Cucumber feature file,and step definition(backend code/glue code) for the feature file, And will be writing a TestRunner class using TestNG.
And also analyze Html/JSON/XML reports at the end of the test execution.
#bddevelopment framework: Behavior Driven Development is a software development approach that allows the tester/business analyst to create test cases in simple text language (English). The simple language used in the scenarios helps even non-technical team members to understand what is going on in the software project.
#cucumber #integration with #selenium :
Cucumber can be integrated with Selenium, a popular web testing framework, to create an efficient and maintainable automated testing solution. Here's how you can use the Cucumber BDD framework in conjunction with Selenium:
Setup Environment:
Install Java Development Kit (JDK) and set up the environment variables.
Set up your preferred Integrated Development Environment (IDE), like Eclipse or IntelliJ.
Create a #Maven #Project:
Create a new Maven project in your chosen IDE. Maven helps manage dependencies and project structure.
Add Dependencies:
In your pom.xml file (Maven's configuration file), add dependencies for Cucumber, Selenium, and any other required libraries.
#CreateFeatureFiles:
Create feature files with scenarios in Gherkin syntax. These files will define the behavior you want to test.
Write #StepDefinitions:
Create step definition files for the steps in your feature files. These step definitions should map Gherkin steps to actual Selenium automation code.
Implement the methods that perform actions using Selenium WebDriver, such as clicking buttons, filling forms, navigating pages, etc.
#GlueCode
Cucumber relies on a "glue" layer to connect feature files with step definitions. Configure the location of your step definition files in the test runner.
#RunTests #TestRunner
Execute your tests by running the test runner class.
Cucumber will read the #featurefiles , match steps to #stepdefinitions, and execute the corresponding #Seleniumautomationcode
Reference URL(s):
sdetadda.blogs...
cucumber.io/
www.saucedemo....
www.selenium.dev/
Playlists in this channel:
Playwright with Java script [2023 latest] - End to end - By SDET Adda for QA Automation: • Playwright with Java s...
TestNG + Selenium 4 Tutorial -2022/2023 🔥🔥🔥: • TestNG + Selenium 4 Tu...
Selenium webdriver issues and solutions: • Selenium webdriver iss...
Basic Linux (UNIX) Commands with Shell Scripting Tutorial for Testers [2023]: • Linux and Bash Scripti...
Top 100 Java programs for QA testing Interviews: • Top 100 Java programs ...
I hope you have liked the explanation and learned from this video. 🙏 Please share my videos and subscribe to my channel 🔔 , also help your friends in learning the best by suggesting this channel.
Пікірлер: 51
It is step by step and very much understandable.Many thanks for your efforts onto this. Please upload full series on cucumber with POM. Thanks again!
@sdetadda
11 ай бұрын
Sure I will
Very nice Lab with easy to understand Cucumber BDD Login scenarios.....practiced along with it , very good learning!!!!!
Good explanation, Thanks a lot.
@sdetadda
11 ай бұрын
Glad it was helpful!
Step by step explanation. Thank you for posting it.
Thank you for step by step explanation of adding dependencies, i have resolved exception error which am facing due to incrt dependencies
Well explained sir ..plz upload more vedio for cucumber
You made my life so easy thank you 😊
Great explanation 🎉
very much understandable sir happy to watch and easy getting all those things make full version of on this topic then it will help us bit more for feature .thank you
Nice explanation Thank u so much
Hi @Raghav, I would like to learn this course. But, I got confused with the set up for this Environment in Eclipse. Do you have any information regarding, which jar files we need to import, maven dependencies, and anything else. Could you please share the information regarding my doubt.
@sdetadda
4 күн бұрын
Please clone the repository from git@gitlab.com:sdetadda/RaghavendraMishra.git to access the required POM.xml file
Many thanks. Lots of love
@sdetadda
14 күн бұрын
You're most welcome.
When integrating Cucumber with the TestNG framework, do you not lose the annotations and other capabilities of TestNG? Because you can just create this framework using JUnit instead of TestNG. Or am I missing something? Please feel free to educate me. Great video as always :).
@sdetadda
11 ай бұрын
Both junit and testng would eventually serve the same purpose when used with cucumber.
Step by step good explanation. For writing test scenarios and feature, please suggest any documents.
Cucumber runner class wont work for 7.8.0 onwards dependencies, So for running the test cases with runner class use TestNG 7.7.1 dependency only
@SrihariNarra
3 ай бұрын
thanks for highlighting this.
Sir, why did we extend AbstractTestNGCucumberTests in runner class? Do we need to extend this to integrate testNG with cucumber? Normally we install testng from eclipse market place and add testng dependency rite?
thank u sir
@sdetadda
14 күн бұрын
You are welcome!
I am making automation tests for a spring boot project using selenium cucumber. Do i have to put any new configurations?
which java version you are using here? and please update me what is latest java version supported by cucumber??
Hello teacher, can I test using a website where I have the source code available? (and how to do it). Because using the url link often causes errors, I hope you will answer!
I can use this framework for API testing as well?Please explain how it will be very helpful thanks.
But we need to create feature file under src/test/Java not resource
How can we run the feature using xml runner file ?
Jun 15, 2024 6:50:54 PM cucumber.api.cli.Main run WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main Displaying this error when running the feature file. Please help me sir
Is there any video for cucumber gradle project
@sdetadda
3 ай бұрын
Will upload it soon into this channel. Let me know your requirements so that I can capture all details possible related to your project.
Hi sir driver error is getting after importing WebDriver and chromedriver
where did u gave chromedriver path
@sdetadda
Ай бұрын
@@sultanbashashaik6531 Not required in latest selenium 4.
I m getting error when I m running it through testrunner file testng not found
@sdetadda
7 ай бұрын
Share the console errors/trace please.
Sir, need a help , i have installed cucumber plugin and testng plugin in eclipse, created a feature file but logo is not changing to cucumber . what should i do ?😥
@praveenalgudkar764
9 ай бұрын
Right click on the project file and choose the option configure at the bottom and choose convert into cucumber project.
@ratishnair4523
9 ай бұрын
@@praveenalgudkar764 Sir , i followed still logo not changing to cucumber
@ratishnair4523
9 ай бұрын
two plugins have installed, i dont know why
@sdetadda
9 ай бұрын
Can you confirm the type of project and also if you can share the screenshot to help you out onto this?
@sdetadda do u have course on udemy?
@sdetadda
14 күн бұрын
Not yet, but I'll start teaching on Udemy soon!
Anyone please help me that I am getting below error/Warning " WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main" because of this my feature file is also not running i tried a lot to resolve this ,did google also but nothing happend.
@ArjunK90
2 ай бұрын
Even same error for me