How to create a Maven Project in Eclipse | How to Run BDD Cucumber Test case with Maven command.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey hello guys welcome back this is viren command so today in this video session i am going to show like how we you can work with the btd cucumber framework and how you can create your first feature file first test case in the vdd cucumber framework what are all the steps required to set up a bdd cucumber framework that i am going to explain in this video in a very simple way so if you are refresher and the bigger beginner and if you want to learn the bdd cucumber you can follow this video and you can understand the basic idea about the better cucumber and how you can create the first test case in the bddt cucumber framework so to work with the bedded cucumber first you need to open your eclipse you if you have installed the eclipse in well and good if you don't know you can install the latest version of the eclipse that is supported by the bt cucumber if you want me to make a video on it you just comment me so that i can make a video how to download and the setup the eclipse and the java for your project so as of now i have the eclipse and the java is already set up on my machine so now to create a btd project or the maven project i am will go to the file sections then you have the new under the new you can create on the project now you can see the selected wizard window will open under this window you can go to the maven folder and under this maven you can select the maven project now you can see the next you have the two options if you want to create a simple project you can select this one and if you want to use the default workspace locations that you are using already and the default workspace locations created by the eclipse if you want to use that one so i prefer to use the default work space locations now you can see the next here you need to select the arc type okay the r archives you have the catalog sessions in the drop down catalogs you can choose the internal in the internal you will get the one options is there or dot apache maven arc types so maven archive quick start 1.1 this version you need to select okay and then you can set the next here you can give the name okay so vdd cucumber demo okay now artifact id you can provide the btd cucumber framework then click click on the finish now here you can see that your project is going to create it this is your maven project so this is how you can create all your own maven project in the eclipse now you have the btd cucumber framework in your hand so this is the braided cucumber framework if we want to explain this better to cucumber framework we have the one src main java pick folder this is the one folder src test java this is the second folder jre which will take the default jr is the version so we can update the jre so as of now i want to use the latest jre version so for that you can go to this library sections okay and then you can edit the jre and you can select the latest version of the jre so what i am using i am using the jdk 1.8 okay so i am going to select the jdk 1.8 and i just want to finish and apply and the close so now now i have the java version 8 in my project now in the src main java you have the one package is there okay under this package there they provide the demo java file that means you can write the code java code in this file or you can create the package with your own name and you can create the java class and you can write the code here second folder is the src test java folder in that also they provide the app test to java they are saying that you can create the test ngo test suite code here you can start from the your testing code here so mainly you can create the test cases so for the test cases you can write the code from here so these are the two folders so you simply you can delete these ones okay we no need to require these ones okay now the maven dependencies are there so as of now we have the junit three point one point three point eight point john okay this is my j unit now i have the form dot this is main file home dot xml file so you need to configure this bom.xml file first okay this this much you will get when you first i'm going to create the maven project for your bdd cucumber framework so you will get the pom.xml file like that okay in the pom.xml file we define all the dependencies so here we have the one very good questions for the interview like why we use the prom dot xml file so you can answer the prompt.xml file contains all the dependencies which will download it automatically when you start the project initially if there is any changes in the jar files it will download automatically that current version of that dependency so manually we no need to download the jar file and need to put into the project so that that's why we use the pom.xml file so you can define all the dependency required for this project okay so to define these ones we have the dependencies in the dependencies plugins we have all the dependencies okay this i will make a separate video to explain the perm dot xml file and so now you can understand this is the boom.xml file these are the target folder the target folder we will use for the reporting purpose all the usan file your cucumber report will generated in the target folder okay so this is the basic structure of the maven project we have created okay so this is how you can create your memon project now i want to integrate with the beta cucumbers how we can design the bdd cucumber framework so for that let me take you to the my existing framework so the bdd cucumber framework is there in the src main java folder we have the config package we have the feature file package in the feature files we have the feature file is there okay the all the feature files we can write under the src main java okay under this you can create the one package and under this package you could you can define your feature files okay so this is my one feature file which i have written the feature is verify google search functionality in the chrome then i have the one scenario and these are the jerkins language so you can define your future file you then i have the second src test java in that i have my test cases so step definitions you can define those so this is the java file under this java file i have defined the step of this feature file so these are the feature i have the three steps which i need to define so for that i have this javascript definition file so in this one user launch the chrome browser so you can see the feature one feature is user launch the chrome browser for that i am giving the implementation in this method so you can see this is the one method or you can see this is the one block okay so how it is coming the steps with these ones then it is having the one block in that block i have defined the code which code you i want to do for my automations so this i have defined the code so launching the browser code is there first i'm accessing the chrome driver then i'm launching the chrome driver maximizing the window then accessing the google.com then we have the second step enter the building in the search box click on the search button so for that i have given the dummy code searching checking and the close like that you can define the code for your automations as per the steps given in the feature file so this is the step definition which is the implementation of these features okay then we have the test runner file so this is my test so under file in that i have the code which i want to execute the features you can provide the path of this feature the feature file path you can provide okay in the glue sections you can provide the [Music] the package name where you are keeping your step definition so in the step definitions i have my uh all the step definitions code so you can give the path that is step definitions so this will come under the src test java okay now i have the maven dependency so you can see all the dependencies are there in my project now how these dependencies are downloaded these i have defined in my home.xml so this is my prom dot xml prepared i will provide this form dot xml in the descriptions you can just copy and paste in your pom.xml file and you can build your project so you just comment me below in this video okay and this is my driver folder in this driver i have my chromedriver.exe and in the target folder i have uh the reports which is generated if any report plugin is there okay now let me run and we'll show how this is working so you can go to the test runner you just right click run as and the junior test it will execute the feature file so the first step is it will launch the chrome driver the chrome has started it will launch the chrome driver then it will access the www.google.com so it access the google.com now we have the search box after launching the chrome search in the chrome clicking one scenario is executed and three steps got passed in 32 milliseconds okay so like that you can create your first test case in the pdt cucumber framework
Info
Channel: Viren Automation Testing
Views: 10,201
Rating: undefined out of 5
Keywords: bdd cucumber framework with selenium, create maven project in eclipse, explain BDD cucumber framework, how to explain bdd framework in interview, how to create maven project, how to run bdd tests, How to setup BDD framework, how to run bdd test in maven, how to run bdd cucumber test with maven command, how to execute maven test as maven est, BDD with maven, Running BDD test cases in maven, Execute maven with BDD cucumber test cases, How to create maven project for BDD
Id: Mc5Hj9_gaYM
Channel Id: undefined
Length: 12min 15sec (735 seconds)
Published: Fri Jul 08 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.