Selenium Cucumber BDD Framework with Java and TestNG - Login Test

Sdílet
Vložit
  • čas přidán 31. 08. 2023
  • In this video, We will automating a login page of "www.saucedemo.com/" 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.blogspot.com/2023/08...
    cucumber.io/
    www.saucedemo.com/v1/
    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.

Komentáře • 44

  • @testing24x7
    @testing24x7 Před 10 měsíci +6

    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!

  • @22kusum
    @22kusum Před 2 měsíci +1

    Very nice Lab with easy to understand Cucumber BDD Login scenarios.....practiced along with it , very good learning!!!!!

  • @AmarKadam-zg6wh
    @AmarKadam-zg6wh Před 8 dny

    Many thanks. Lots of love

  • @TestingUnlimited
    @TestingUnlimited Před 7 měsíci

    Step by step explanation. Thank you for posting it.

  • @nikhithamadishetti4953
    @nikhithamadishetti4953 Před 17 dny +1

    Thank you for step by step explanation of adding dependencies, i have resolved exception error which am facing due to incrt dependencies

  • @praveenalgudkar764
    @praveenalgudkar764 Před 7 měsíci

    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

  • @riyashukla1717
    @riyashukla1717 Před 10 měsíci +3

    Well explained sir ..plz upload more vedio for cucumber

  • @Akash07ify
    @Akash07ify Před měsícem +1

    You made my life so easy thank you 😊

  • @prikalpanda7864
    @prikalpanda7864 Před 9 měsíci +4

    Good explanation, Thanks a lot.

  • @ganeshmuthu7275
    @ganeshmuthu7275 Před 2 měsíci +1

    Great explanation 🎉

  • @poojashinde9494
    @poojashinde9494 Před 2 měsíci

    Nice explanation Thank u so much

  • @user-cn7ly1tg1u
    @user-cn7ly1tg1u Před 3 měsíci +2

    Just awesome

  • @gangeshmishra4880
    @gangeshmishra4880 Před 6 měsíci

    Step by step good explanation. For writing test scenarios and feature, please suggest any documents.

  • @poojapawar5916
    @poojapawar5916 Před měsícem +1

    thank u sir

  • @sahil98031
    @sahil98031 Před 10 měsíci +3

    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
      @sdetadda  Před 10 měsíci +1

      Both junit and testng would eventually serve the same purpose when used with cucumber.

  • @prabhakarmishra5099
    @prabhakarmishra5099 Před 5 měsíci

    which java version you are using here?
    and please update me what is latest java version supported by cucumber??

  • @rachaitabasu876
    @rachaitabasu876 Před 8 měsíci

    I can use this framework for API testing as well?Please explain how it will be very helpful thanks.

  • @TranTran-oq1it
    @TranTran-oq1it Před 3 měsíci

    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!

  • @user-cj6vb8fs9v
    @user-cj6vb8fs9v Před 2 měsíci

    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?

  • @AsadSaeed-yn8nh
    @AsadSaeed-yn8nh Před měsícem

    I am making automation tests for a spring boot project using selenium cucumber. Do i have to put any new configurations?

  • @snehalmetkar
    @snehalmetkar Před 3 měsíci +1

    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

  • @shaheenafirdous8877
    @shaheenafirdous8877 Před 6 měsíci

    But we need to create feature file under src/test/Java not resource

  • @dhammakkapandav9330
    @dhammakkapandav9330 Před 2 měsíci

    Hi sir driver error is getting after importing WebDriver and chromedriver

  • @ratishnair4523
    @ratishnair4523 Před 7 měsíci

    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
      @praveenalgudkar764 Před 7 měsíci +1

      Right click on the project file and choose the option configure at the bottom and choose convert into cucumber project.

    • @ratishnair4523
      @ratishnair4523 Před 7 měsíci

      @@praveenalgudkar764 Sir , i followed still logo not changing to cucumber

    • @ratishnair4523
      @ratishnair4523 Před 7 měsíci

      two plugins have installed, i dont know why

    • @sdetadda
      @sdetadda  Před 7 měsíci

      Can you confirm the type of project and also if you can share the screenshot to help you out onto this?

  • @vayamupadhyay966
    @vayamupadhyay966 Před měsícem

    How can we run the feature using xml runner file ?

  • @shaheenafirdous8877
    @shaheenafirdous8877 Před 6 měsíci

    I m getting error when I m running it through testrunner file testng not found

    • @sdetadda
      @sdetadda  Před 6 měsíci

      Share the console errors/trace please.

  • @shivalingeshpatil2729
    @shivalingeshpatil2729 Před měsícem

    @sdetadda do u have course on udemy?

  • @ArjunK90
    @ArjunK90 Před 15 dny

    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

  • @ramandhiman428
    @ramandhiman428 Před 2 měsíci +1

    Is there any video for cucumber gradle project

    • @sdetadda
      @sdetadda  Před 2 měsíci

      Will upload it soon into this channel. Let me know your requirements so that I can capture all details possible related to your project.

  • @abhilash7193
    @abhilash7193 Před 3 měsíci +1

    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
      @ArjunK90 Před 15 dny

      Even same error for me