Login

Lost your password?
Don't have an account? Sign Up

Selenium Cucumber Java BDD Framework 1 – Setup | Step by Step | Raghav Pal

Free Tutorials –
Quiz –
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

Join this channel to get access to perks:

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 or any animal welfare group near you, in any way you can.

Free courses –
Udemy Discounts –
Stories –

https://www.educational.guru

48 comments

  1. Sakikog Oo Kheng

    Hello Raghav, I would first like to thank you for all of your hard work and great tutorials, I’ve finished watched your beginners Selenium course. One point I’m happy to make is you’re now choosing descriptive file names, everything on that course was “test1, test2, test3” etc., a great improvement. Keep up the great content!!

  2. Automation Step by Step

    In case you face issues generating HTML REPORT at 35:32 then under target folder manually create a folder named HtmlReports and in the code add the following:
    plugin= {“pretty”, “html:target/HtmlReports/report.html”}
    (names can be changed)

  3. Ronak & Juhi Vlogs

    Hello Raghav! Thank you so much for this video. It is very helpful to understanding. I learned BDD framework only from your video. Since long times I was getting lots of errors but your explanation is awesome. Thanks a lot again!

  4. Monica Goyal

    Hello Raghav, I was struggling with Cucumber project for 3 days due to dependency issues and was just thinking of dropping it but then you came as a Silver Lining in Dark Cloud.Thanks alot for sharing correct dependencies and such a precise presentation.Finally,I have correct jar files and project is working.
    One query or suggestion, I was getting errors “Cucumber Options can not be resolved to a type”.When I changed “test” as “compile” in xml file then it worked properly. Am I going in the correct way? BTW, thanks again.

  5. V Vignesh

    Thankyou sir, your explanation and the way of approaching and the acsent all in a prefect sync. Making your sessions more intresting and very eager to learn. Thanks a lot for your great work sir.

  6. Adrienne Cheng

    Thanks Raghav! This is very helpful in a easy understanding explanation! Can’t wait for following sessions, please include bobcat framework, especially with bobcat aem6.5 module please!

  7. Dominick kennedy

    Hi Raghav, Am new to selenium, trying to learn from the scratch. This video was very useful. I was trying the same steps as you and it gave me lot of confidence. Your explanation and teaching is so good. Thanks a lot. will proceed further with other videos.

  8. Srinivasan T

    From the bottom of heart, I say thanks to you sir, my project was stuck, struggled for more than 3 days, atlast saw your video and got it cleared sir, thank you so much, please continue your great works sir

  9. Laura Graham

    This is an excellent tutorial and I am so glad I found. It will familiarize you with everything you need to know to get started and give you a good foundation for learning more. Thanks so much!

  10. Jeyakumar Arokcia

    Mr. Raghav. It is really really and really fantastic. I just follow your each second of deployment, and now i learnt a lot and end i am able to create the xml, hmtl and json based reports. Wow…more clarity…step by step…slow moves….. Your this video gives me more confident also. Surely will visit your series. Keep educate us/me. Thanks. Jeyakumar from Houston, Texas.

    1. Suraj Bobade

      Hello Raghav,
      I am facing the Html reports issue. The report is generated only but missing some files such as you mentioned index.html and also showing some warning on project icon how to resolve this, Thanks for advance.

Leave a Comment

Your email address will not be published. Required fields are marked *

*
*