Selenium WebDriver Java Framework From Scratch | Part1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right yeah yeah before getting into the uh this framework implementation for selenium java okay so um you guys might have worked with you know selenium java alien in your previous projects of you know company um the prerequisites to this uh station okay you guys must know um the core java concepts okay uh for writing the programming using selenium selenium right so and you must know some of the uh test ng unit testing framework concepts like different kind of annotations that we use uh in the test ng framework right okay and also should have the basic knowledge on the uh page object or model okay pvm page object model mechanism um how you guys implementing um the page object concept in your selenium automation framework and also you should have the basic uh uh not basic i should know the um concepts of selenium selenium webdriver okay so without knowing the selenium webdriver concept okay probably you will not work with the framework implementation go on that you cannot work on that right okay so you should know the selenium web driver concepts um java core java concepts also uh you must have knowledge on the test ng another guy's fine once you can yeah yeah you must you must know the test ng um unit testing framework concepts i mean annotations like that and also should know the basic concepts of the uh maven also live in build tool and apart from that uh i i thought to um also include this uh bdd of feature file implementation i mean feature file concepts probably if you have a time then we can uh finish with that also so initially i'll go with you know uh basic framework so gradually i'll be um uh make it a robust framework for selenium java okay okay so um do you guys know what are the um prerequisite softwares to uh set up the selenium java framework in your machine yeah you might have an idea right okay so probably if you want to work on the selenium java okay you must have you know couple of tools that you have to install in your uh system okay so on windows we are working on windows right now okay so the prerequisite software is like you know pretty good lights yes you know right so jdk okay jdk 1.5 version must have been installed all right and then after so if you want to write a code on selenium java right okay you must use some editor it can be a clips or it can be intelligent ide or any other software but you know mostly the companies are using eclipse and this second position you know intelligent ide but you know it's based on the location based on the company the requirement okay all right so we're going to use eclipse ide okay uh in that you know there are different kind of packages uh you see that i mean different kind of versions you can talk about or you can you can see different kind of packages i use oxygen um oxygen uh probably it's a 3.0 something like that okay you can also use uh kepler you can also use uh juno but probably the people are you know there are so many people are facing issues with those kind of versions okay if it is fine with your um with you but that's okay you can go and use and choose any version it's not particularly going through the oxygen but my side i'm using this oxygen which is uh stable and you know um extensively used for selenium automation testing all right okay so jdk and eclipse and um uh what else we have we have the uh selenium jar files right because you know we're gonna work with the selenium so probably you need to use the um this is for you know selenium web driver selenium web driver client jar this is very very important and after that um you'll be working on the test ng uh framework right so test ng just like you know unit testing framework okay you can use the test ng jar also okay all right so test ng um is a unit testing framework is fine and after that so i'm gonna implement um what we can say uh i'm gonna add the reporting structure right so the reporting structure i'm using extend report okay so this is the third party software which you are using for you know generating the report as part of the selenium uh java framework okay we have a different kind of you know reporting tools in the market uh one is the extent report and the other one is um we have a aut reports and we have value reports and uh we have a customized report so if you want to customize your report okay that's based on you know based on your java programming knowledge okay you can also use you can also customize your reporting structure okay you can also do some coding you know uh create a different kind of you know reporting structure based on your client needed okay if client doesn't want to uh require this extended report or your other e2 reports you can go and customize the uh report based on your customer requirements all right um okay fine um then after um i will be adding a couple of jar files like you know the bd cucumber uh jar files okay this is for you know feature file uh feature concept feature file implementation all right cucumber all right so anything else we are missing guys okay these are you know uh uh pre-equalized to the you know set up your um selenium java framework into your machine right and also you need to add uh the plugins the plugins is the next level we'll talk about the plugins too all right so when you install i'm not going to join yeah yeah when you install uh this one i've taken my laptop open yep all right so plugins to plugins to eclipse okay so if you're working with the clips right so probably you need to add some plugins to work with you know selenium framework okay selenium java so what kind of plugins you required so definitely this required test ng plugin test ng plugin and also a maven plugin and cucumber plugin if you are implementing the uh this one you can also use the cookie plugin and any else anything else you guys are to add plugins mostly uh this is fine uh reporting anyway we are adding the external jar files fine this is one all right okay so let's go one by one and if you if you're missing something else we can add in the middle that's not a problem okay let's start with the um the setup in these softwares okay there you are i already installed this software into my machine but anyway i'm showing once again so jdk download okay when you just type jdk downloaded you know the first and you know foremost url you can see that article.com okay so just click on this link uh and try to install uh any of the latest version but you know guys you are installing the um jdk 1.10 i mean jdk 10 okay so they're facing a couple of issues um they're not able to recognize these some of the jar files into the eclipse so i'm suggesting you to download the jdk 1.8 that is 8 jdk8 and if you go to the bottom let's go here jdk 1.8 jdk8 or 1.8 is fine let's type this guy come here all right so in the bottom you can see that in the jdk uh java sc development uh kit um 8u 251 and based on your operating system you can go and install that if your windows 32-bit you can go and install this guy and if you're windows 64 then you can go and see this guy you know how to check your uh the windows type you can go to this pc right click on this one properties this is the one system type is a 64-bit operating system okay so i'm going to install this guy this one okay just click on this card then accept this one download it okay so it will ask you to log into this website because you know for people are you know using for the automation purpose that is the reason they are making it is you know uh secured one so that is a you need to authenticate to this one and probably you need to create an account with your gmail account and just enter details okay it's going to download into my uh into your download folder okay so once it is downloading to your download flow right you just click on the um that particular jdk and click next next next next okay how did it work it will take you know um um one minute or like that okay so you know right how to how to install the jdk and all those things okay and then after um the eclipse okay okay so before getting to that so jdk is installing if you're if you want to re-verify that jdk is installed into your mission or not go to this pc uh local c drive probably you can see program files here you should find the jdk folder here okay you come here and check re-verify um whether you have successfully installed jdk 1.8 or not if you have any uh previous version into the system okay so probably you better uninstall those things and install only jdk 1.8 okay there will be no confusion with that okay so anyway um after installing this one i'm trying to go go and set this environment variables for you know if you want to run your java um coding from the command prompt okay so i'm gonna save this into the environment variables this pc go properties advanced system settings all right uh go to advanced tab and environment variables okay so here uh the system variables you have to set your java path okay java underscore home sorry did you ever underscore home and give the path okay give the path so i already given i'm just closing it and after giving that and you come to the um this one let me check this java is there or not it's not there right that's not it okay let me go and check first once open the command prompt java iphone version i'm sorry watch yeah i can see this is already set let me go back and check once again i cannot see java here i'm not seeing anything here you're also not seeing anything but anyway i'm setting once again java underscore home and copy this guy and paste here okay till java only copy above one okay button and come to the path properties okay path properties and edit button and here you have to create a new uh n1 variables percentage and this job underscore home again percentage slash kill bin folder okay where java application dot exe file exists okay click on this guide okay button okay button okay so environment variables done for the java and then come back to the eclipse right okay so you have to visit the eclipse.org website there's term visit this website eclipse.org all right so uh this is a basically it's a exe file that you have to [Music] options downl like you know eclipse id for java developer just click on this guy so probably you'll be redirecting to the actual one i don't think this is the icon which i'm looking out for uh come back here download packages you see that you see this you see the different kind of versions you want to choose at okay so which is the best one okay so choose this guy remember this icon okay choose this guy and based on your operating system you go and select the particular one just click on 64-bit eclipse ide for enterprise java developers click on the screen um once you again if you go back here if you go back here you see different kind of versions here you see these packages uh oxygen package eclipse you click on this guy and here you can select if you want yeah now you can select here 60 bit 64 bit and click on download one so this is a free of course you can anyone can use it for java programming and if somebody wants to use for any other programming also they can also use that eclipse okay so this anyway um it's around 334 mb i already downloaded into my system i want to use the existing one probably i can go and open my eclipse yeah um so once this is the diaphragm right so once it is downloaded into a system so what you what do you guys need to do you just have to extract this file and this will be extracted like this okay eclipse folder and inside that you will see the bunch of folders here and you need to click on the application file here eclipse application file not eclipse ac not eclipsey you have to click on this icon all right so once you open this eclipse right so you will see the workspace where you want to place in your source code okay your project source code so you want to create a different kind of workspace that you want to separate into your c driver d drive you can place i just want to create a folder here in the c drive uh make a new folder this is called selenium java i'm sorry um what is that here is the one selenium java framework ops okay fine no shows come here all right f2 selenium java framework all right i'm selecting this guy okay button so this is the new workspace that you'll be creating um the uh your selenium java framework i'm just gonna launch it okay so there are a couple of more options will be here don't use this uh use this as a default and do not ask again okay please don't check this one otherwise you know when you open reopen this eclipse right here once you restart your machine or you know once you restart the eclipse you will not see this window okay so probably you all we end up with you know you cannot change your workspace if you want to change your workspace you cannot change that that's the problem okay just don't check this one click on launch one all right so let me go and see the other one all right um here uh we are done with this jdk eclipse pack i'm opening right now and a couple of more things all right so maven so maven is one of the build tool uh which we are gonna use for selenium java automation framework okay most of you guys know about the maven right maven isn't build tool basically you know while you are using the maven uh initially this maven was developed for the developers not for the testers okay uh but later point of time you know the testers um um wanted to use for you know to making uh the automation framework robust and you know maintaining is easy okay it is understandable where the folder was uh structurally designed in the maven project okay so if you have any kind of if you want to know more about the maven right so you have a lot of website you can go and visit that okay i'm not gonna uh explain each and every concept right it's gonna take a lot of time all right all right so let me go and um yeah so this is one uh so as soon as you open eclipse right you'll see this window okay probably you can click on this works pinch or else you can click on this um this restore icon come here okay you will see a lot of windows over here right okay just just close all those guys always guys guys i think the session is recording right i'm fine all right all right so this is the this is the left side in the project explorer where you can see the projects or different projects that you are going to create okay and the right side you know um whatever the file you are going to create left side right so if you want to see the view of that particular file you can see the right side pane all right so better to get hands-on experience in the uh shortcuts of the eclipse so that you know work with your work will be smooth okay and you'll need to spend a lot of manual stuff okay all right so if you want to start with the selenium um java frame bucket so obviously you have to choose a maven as a project okay um we we you know right now uh nobody is using the general project for the selenium java framework okay because that's not uh gonna be best practices for the automation guys all right so i'm going to use a maven project so how to create a project here in the eclipse go to the file go to the new and here you will see a different kind of projects here guys if you have any kind of different versions okay apart from this oxygen right okay you will not see these many options okay so nowadays now the eclipse um guy is providing all the inbuilt projects here okay um they're giving you know a lot of stuff here so if you go to the other kind of you know packages right june or kepler so you will see the maven project and all those things in the uh others here you will see the project's names here okay so if you want to create directly maven project here come to the file and new and click on the maven project this is what click on this maven project all right see when you are trying to create a project here right so you'll see this window new maven project okay and here there are a couple of more options here i'll create a simple project i'm just gonna select this guy okay click on next and here the people are getting confused you know what is the group id and artifact id okay so no need to confuse that it's not that much you know difficult to learn about this one basically these group id active id or gonna be created in the prom.xml file and this group id artifact id uh act like you know this artifact id is a project name that you are gonna create okay example i'm gonna create um a selenium java framework okay i want to see this framework name at the left side okay so the artifact add is a project name and group id is going to create example selenium dots java dot project you can give anything here okay there is no particular thing that you have to give here you can give anything that's not a problem okay so these group id in artifact is part of the maven projects okay these will be there uh in the form.xml file and finish button all right so it's getting created you see in the bottom and guys want to create the maven project right don't try to change the name of the project name okay otherwise you'll end up with a lot of um errors okay lot of errors so once it is created just you know keep it as it is go with that particular name or you want to change it you can change it but you know the people are getting some issues when they're working with i mean when they're changing the project name all right so it's still getting created the project and uh you right now if you see these writers when you're working with the maven project okay the the form.xml will be automatically created by the maven project and this com.xml is the heart of the maven project here this heart of the maven project without bomb.xml you cannot work with the maven project that is what is gonna hear okay all right you come here you see the two different uh artifact id and group right here you see this these are placed in the uh format xml and this one is reflecting here by the project name all right so what is the palm.xml okay um see people are getting confusion what is the difference between uh maven pom and you know the framework uh palm uh this is the project object model and that is the page object model and you need to remember that you know crown product symbol is a project object model okay so where you need to define all the um related different dependencies to your project okay if you're working on selenium project right and you need to keep keep all those references in this particular format xml so that we can access those particular classes and interfaces in this framework all right this example you're working with the other kind of languages or kind of you know frameworks okay you need to use those references the preferences in the sense you know the jar files uh kind of stuff the dependencies we can talk about differences all right it is created here okay uh yes so this is the folder structure you see this um src main javascript resources is java test resources so basically for developers they are going to use all these kind of folder structures for testers you know mostly use two or three not all the things uh i don't know i don't want to use this src main resources remove this guy okay if you don't have if you don't want this particular folder right okay you can remove it okay unnecessary now we're going to be confused for you all right so what is the purpose of these three different kind of source files uh source folders are placed in the maven project okay what is the reason so do you have any restriction to create this particular file in this particular folder there is no distinct restriction guys you can create anything anywhere in this particular folders but when you're working in a maven project right we need to follow certain standards to maintain your framework in a robust way all right and the other girls also should understand uh when you're working with this framework okay uh they also having some idea in their mind saying that you know okay src this job in a sense you know all the test scripts will be replaced in the particular folder and what is the test uh src test resources and all the source files like xml files excel files uh any kind of flat files dot csv or dot json okay or dot properties um yeah probably these kind of files will be placed in the resources file so they have different kind of mindset when they are you know working with the maven project so we have to follow that particular standard okay so now i'll tell you see src test java is basically where you will be creating all the different classes okay which are used to your framework all right only classes okay and it's not uh we're not respecting to use only for classes you can also use anything but you know you have to follow a certain standard all right so when it's come to the test s resources right so here we'll be using um kind of no dot xml files it's a kind of dot cc files um json files csv files so all these files will be placed in this particular folder why we are using all those files example if you want to uh parameterize your test data from the excel file so those kind of excel files test data will be placed in the test resources okay that means you know for testing resources testing the resources is a kind of no different kind of files all right and if you want to add any kind of you know a main java okay so here you can place anything it's not a particular one i probably use for the main java is for page or object page i mean page factory and i also use sometimes for you can say screenshots screenshot capturing and also used for reporting also you can use for that okay the specific one okay specific one don't should not be get confused you know uh placing the uh the common files in the different different folders okay use the test java file only for classes and interfaces and resources for only files that xml file csv json xml and this will be for the screenshot capturing a report purpose whatever you want you can do it okay others you can create if you want to create a different kind of folders in the project level i don't want to use these things you can go and create here uh example here i want to create a different folder come here new folder uh this is going to be uh example test report yeah i'm going to use at this bottom okay all right okay so i see the other one here src here also i'm see i'm seeing the src main test java okay so don't get confused this one this one is a part of these these folders okay whatever the files you're going to place in this particular folder site when you compile the code automatically the dot class files will be generated in this particular src main test java folders okay forget about this one don't worry about that okay and the other one is a target folder okay the target fold is one of the important uh concept of the maven project uh target fold in the sense example once you compile all the code right okay all the code so all the projects related class files and interfaces i mean all the files will be created as a dot class files and also jar files okay project jar files as well as class files and whenever you clean the maven project it automatically clear clear those dot compile i mean dot class file which are compliant earlier that will automatically clear when you run the maven project okay all right okay so let me um set it up once uh this is my project right now and here you you have to set you know common things here as soon as you create a project guide you have to set the jrd system library right click on this one properties and here the current um uh engine is jre engine is running right now but if you want to work in the selenium java right so you have to run your framework on gdk java development kit okay so in that case what you to do you just go to the install chats add your is next directory this pc so i'm looking good for the way the java is installed information local c drive all right where i'm seeing that [Music] program files come here java till jdk only not been okay all right so these are different jar files are placed in the or jdk on pentaho finish it and select this jdk once apply apply close now here you have to select uh jre as the j2 ac is 1.5 selected and it should be targeted to the jdk 1.7 and jdk okay it has to be selected this one all right okay and yeah uh guys so this is a questionable for five minutes okay any questions we can ask please because we're gonna we're gonna start uh now uh build up the framework as fast as we can guys any questions refer because i'm a bit fast because uh time is not sufficient right so two hours we won't i mean two hours it's not sufficient to finish this framework okay so if you want to implement this framework in your company that probably you'll take you know a week right okay so guys any questions please feel free to ask any questions any any any questions any layman question also really will be answered if you do if you don't have any questions i'll start another immediate any questions related to these softwares or projects anything anything out of the box no question guys at least says no questions yes it's fine wonderful wonderful guys see okay so we will come to the first you know people are getting confused when they are creating this selenium java frame okay where to start okay they are stopping there itself where to start how to start when to start okay so uh guys before getting into that can you see my this font let me increase that font shall i increase that font probably have to increase that yeah it's fine it's fine right because i can see that in a small oh it's fine it's fine all right selecting the best framework best best first font as you can see that all right i think you can see this now fine all right so people are getting confusion uh even though they are expertise into the selenium concepts you know they can easily work with any kind of any kind of framework they can also easily work with you know writing the test scripts and all those things they can easily implement the any kind of reasonability method at the framework level but still they're having the confusion where to start and how to start and all those things okay guys keep in mind when you want to start a selenium java framework there are a couple of more couple of things that you have to remember okay you have to um recall first of all come here okay so first you choose an application what is the application so it is a web application it is a web application okay so i'm gonna take uh uh application called uh demo webshop uh which is having all type of controls so that we can automate this one this is the one okay i found this is the website it's the right website i can automate it okay so you guys also if you want to automate any website so come to and land on this page and try to automate this website probably you can you can actually you know all type of all sorts of the uh concepts covered as part of the selenium concepts okay all right i'm taking this as example so you need to think first okay this is my website okay um you need to go through the website once okay so this website is basically designed by the dot net okay and this is for you know i'm just saying you know sample this uh website designed by the dot net uh um as a background development um they use some html as a front-end development and also they use some database mysql okay or you need to think about the application type okay it's a dotnet application okay so i'm trying to choose a selling name automation selenium is a automation tool for to order this website for javas.net probably the selenium will definitely support 100 percentage no doubt in that okay maybe a few of the controls which are designed by other kind of tools probably will not support okay so first you need to go through your website completely okay and check all kind of screens that you're having okay what kind of application what kind of functionality being developed okay all these type of uh scenario i mean all these type of contours that how it designed and all those things okay check all the screens okay it's perfect okay there is no loading kind of stuff it's perfectly loading inside in time okay i can go to any other sites any other page i can go and use that okay so after going to the your website right okay you need to identify a couple of more things this website has lot of pages a lot of screens a lot of models probably i need to choose a page object model probably i need to choose a page object model concept to my selenium framework okay i need to note it down for my web application i need to choose uh the um what is you can say page object model i say a design pattern okay guys you should know one thing page object model is not a framework people are calling dummy you know it's a framework it's not a framework it's a kind of in a design pattern that we are using at the framework level we are using the design patterns design patterns okay it is a design patterns all right all right so the decent pattern we are going to use it because in my web application there are more type of you know i can see a lot of models here lot of screens here probably i need to choose a different kind of screens or different kind of pages into my framework label all right let's example if you have if you if your web application is having you know only few screens few screens like you know two to three screens some application will have only two three three or two to three scans they would have much screens if it is a small project right you will have only one or two screens in that case probably the page object model may not apply page orbit model may not require because you know if you want to implement the page object model concept in your framework right it's going to take time without taking i mean ended up instead of taking time on spending implementing this page operating model into your framework right you can go and use a common uh framework okay it's a common framework you can use in your data table framework that is that is more than enough right so we have a different type of framework data driven framework hybrid keyword driven um page update metal design design pattern and vdd cucumber okay so these are the different type of you know frameworks are available in the market and also getting confusion okay you're saying your page update model you want to take it i do why why should i not think about the other frameworks data-driven framework is here why should i not that and why should i not take this hybrid framework we have a keyword different framework guys the keyword driven hybrid and data event is outdated now why outdated still people are using the companies it's not outdated okay they have a different kind of mindsets and saying that you know the hybrid and you know these data driven is completely deprecated they are not using the companies of course they are not using the company if it is a big projects if you are working for a big project in the company right probably they won't use these models uh these frameworks like you know the data-driven keyboard driven they are not using it why they are not using it you know we are necessarily making a complex our framework why complex simple so when you're working with a web application right guys you have to be so careful on identifying the objects identifying the objects okay identifying the objects is not a difficult job but way to face way to place it i need to place somewhere else all these object properties i need to place somewhere else i need to place somewhere else if it is a big application placing all the properties in one place is going to be difficult if it is a bigger application this is a big application right okay you have a lot of screens here if you want to keep keep all these properties okay all these properties in one place okay that is going to be difficult for your framework to maintain i'm not talking about the page of your model page object model will facilitate to easy to maintain your what is that properties properties of a web element that is the reason the page object model becoming famous nowadays okay this design pattern famous becoming famous because of it's giving okay lot of um benefits to the uh you can say customers or else lot of benefits to the automation testers okay whatever the um properties that you're taking you're placing in that particular file only that page only for example there is a registration screen okay you will be creating one registration page in your framework and you will be placing all these controls in the recession page only and if it is a login page you want to create a login page into your framework and you will be placing only login page properties in that particular folder only in the independent file only okay so that means the maintenance is easy the maintenance is very easy if you want to place all these file properties in one place it's going to be difficult to manage and it's going to identify the failure at runtime it's going to be difficult okay that is a traditional that is a um old framework like you know data driven framework hybrid framework keyword driven framework they are using all these properties in one place but when you come to the page update model they are using all the controls in different different pages which are which are with respect to that particular page all right and also maintenance is easy if you're facing any issue at runtime okay you can go and directly visit that particular screen on particular page and you can easily identify that okay so that is the reason we are using the page object model okay and also um this is one of the major important advantage when using the page object model there is no duplicacy what is the when it's come to the um data-driven framework or hybrid and keep a driven feedback right you will see the duplicate functions and you will see the duplicate properties duplicate functions and duplicate properties okay example if you want to identify a particular element okay driver dot find element by dot some register dot click this will be using across all the different kind of test scripts you have a bunch of test scripts you want to use that you will be using all different kind of test scripts if it is a failing one place you have to fix all the test scripts okay so you will have duplicacy and you have a maintenance difficulty in other frameworks the benefit of page upgrade model is maintenance is easy and also there is no duplicate okay so why do we waste our time no to this explaining all these things we can directly go and implement that page operating model i want to see that so if you want to implement that so first of all what i'll do i'll go and create a folder structure first okay you don't need to create all the folders at once based on your requirement you can go and create those things first of all when you're creating the framework and if you want to create a particular i mean uh folder structure right okay you come to this srcd java right click on this guy new and this is the package name package is nothing but it's a kind of folder it's a kind of folder i want to create a different different folders where i want to create different different classes instead of creating in one package i mean in one package creating all the classes it's going to be difficult i mean it's not going to be difficult it's not a it's a confusing topic so i'm going to create difficult uh different packages here okay so here uh the people are know in the companies they are following different kind of standards i'm following com. your project name dot and type of class or type of class that you are creating this particular package okay so my project name is demo webshop demo web shop okay you can give a project name and here test base okay see first if you if you if you're confusing to create okay which one i have to create first okay first you go and create the test base test base is the heart of the your selenium java framework okay i'm going to create this package okay and after that i want to create a class inside that test piece this is called test base guys the birds the first letter should be capital if you are giving the small iterate it will give you a warning okay this is not the best practice that you have to do uh test is a capital or if you want to give the the i mean the consecutive words also should be capital like test base finished up it don't select any main method guys do not use any main method in this when you're working with the selenium testing framework okay all right so class is created so before writing the code inside the test base okay we'll talk about the sessions later first of all you should um add all the references jar files into your project okay so as we discussed in the uh this one right here selenium jar files okay if you want to use selenium um classes and interfaces cellular webinar class and interfaces into your what is that classes okay probably you need to use the jar files right so how to use the jar files here see we will be not using any kind of adding any gel files in this particular project because we are using a maven project maven project will help you to add the particular dependencies related to the particular jar files okay so earlier you know if you want to uh add the jar file i mean if you uh when if you created the general project here you have to add the jar files okay that mechanism is deprecated right now now if you want to add jar files to a particular maven project you have to come to the maven repo website okay and here this is the website mavendeposit.com and here you need to search for the particular jar file okay i'm looking for the selenium jar file if you don't know particular name of the jar file you just type selenium you see this there are different kind of jar files here psyllium javascript api support server but which one i have to take it so guys when you're working selenium web brow right okay we are working java and selenium web driver is a client driver which is us i mean which is supporting to the different languages java c sharp ruby python php javascript okay so we are working in selenium java right so we have to select this java and right now the latest version is 4.0.0 alpha which is not officially released to the uh users outside so i'm not suggesting to use this and better to go and use 3.141.5 okay click on this guy here you'll be landing to these selenium i mean the dependencies okay so here if you want to add the jar files you can download here also no i don't want to add jar files i want to add a dependency here you will see that copy this guy come here and paste here same pressing i'm getting some error here you see this okay why i'm getting error because this dependency should be under the dependency stack dependency stack you see that dependencies tag okay cut this guy come here paste here once you save it right automatically it's downloading the jar files you see that whatever the bunch of jar files there in the client driver selenium client driver uh web door line driver what are the jar files are there so that will be downloading now so it is taking some time 98 percentage 100 done and you will see created folder here i mean creator file here amazing dependencies you see this these are the different jar files which are wrapped up into the selenium java selenium java okay selenium brother java all right so i'm done with the selenium java so probably i can go and use the selenium stuff here come here test base um what to create basically web driver or a favorite interface okay control space and you should see the inputs of the particular uh chart file okay here you're not getting anything you see that you're not getting this click on this guy i'm trying to create an object for this all right so now i can use the uh different kind of classes and interfaces sidespot of the selenium java client drive right now fine that's fine so i'll be adding couple of more things what is that next one test ng also come here go there test ng all right come here and open the test changing ones here this is for unit testing right so if you want to use the different kind of annotations at the framework level okay so probably you have to use this you can take the latest version which is here 7.1.0 click on this guy and copy the dependency okay all right save it see once it's saved once it paste and save it right so automatically download the jar files here you see the left side here where the test ng is installed you want to see that what is that here testing the iphone or testing iphone 7.1.0 you'll see that so tomorrow if you don't want to use this jar file right you just comment it you just comment it ctrl shift uh backslash okay probably you see this once again this one [Music] all right so just comment this contextual background save it okay it's automatically removed from this particular membrane impedances because it's no longer used in your project level okay i'm just unblocking it so this is the beauty of you know maven form.xml okay whatever the jar files you want to use you can use for that okay tomorrow you don't want to do these jar files okay this is not required to my framework you can come here and you can just comment it okay all right and then after i'll be using couple of more things excellent report extend report will be using it right so come back to this one type extent extend report all right all right so you see this automation chicken extend report what is that okay i'll do one thing i'll just remove the sky type extinct yeah i'll see that um excellent report so i'm in stack calm down stack just go here remember this guy uh com.event stack extend reports come here uh probably i don't want to take this latest version um i probably take a different version let me see the version that i've taken earlier um extend repo 2.4 point okay let me go and use that anyway i even i want to use the 4.1.7 that's not a problem copy this guy copy this one uh i don't think this is the one that i've used okay anyway let me see the previous one three point one point i've been stuck see uh if you go back to the previous version right like example in two point two zero um the the package name the group add is difficult different that is a relevant um uh relevant quotes like that okay recently the this excellent report guy changed lot of stuff okay uh the reporting mechanism kind of stuff okay copy this guy copy this guy anyway latest one paste here all right see these jar folders is getting downloaded so right now what we're doing we are just you know um uh adding the particular references i mean jar for references to your project if you want to work with you know your if you want to design your framework extensively with all kind of um inputs okay it's also all sorts of you know concepts that you want to implement as part of your framework right you have to use all jar files classes and all those things okay and this is fine and what else we have um the other one is uh if you are when you're working maven project right okay probably you have to run this maven project i mean maven project with the maven goals okay there are a couple of um concepts uh it's not a couple of concepts there are a couple of models that you have to use when you're running the maven project okay if you want to know more about the maven right so you better to go and learn them even our tutorials okay so that is very very important for you to learn and here after adding these dependencies right so okay the one of the most important things you need to add plugins for the maven okay this is where the maven uh project or basically trigger to run your classes from the project okay so here it will be adding into the build okay in the build build tag i'll be adding into the plugins okay these are different kind of plugins that you have to add enter and here sorry what is this all right come here and here you need to add different type of plugin inside the plugins you can add different type of plugins you can type of plugins okay all right so the first plugin that i want to add inside this plugin okay the maven um plugins the maven plugins maven should 5 plugins where is that i can find it may even shoot for plugins uh if i go here ctrl t and google you can find maven surefire plugin sorry surefire plugin for maven it's a plugin date this type of plugin is not a dependency guys plugin you will find the different things here uh you can see that no way here go back probably can see no yeah it's a this is different again i don't want to use this guy i'm sorry examples java codes i think this guy is having a couple of things all right so where is that maven should we plug in you see this so this is the plugin where you have to add it so just copy this guy only so not everything copy till here okay copy it here i'm sorry where is this close pop-up i just copy these things come back to your listings paste here okay and inside that okay all right so when you're working with the bom.xml right okay if you're running the promo.xml okay it doesn't recognize what you want to run bus you want to run something else yes i want to run a test ng xml file from the prom.xml so in that case you have to use a configuration concepts confirming the xml files here suit file suit xml files i'll talk about this at testing.xml later let me create it first xml files and here inside that suit xml file all right so here you have to use test ng dot xml but where is the testing.xml okay okay i'll go and create one file here right click on this project go here file okay test ng dot xml see when you're creating like this right testing.xml the project level okay so it automatically recognize that this file at the project level let's say example if you're creating this file into particular folder right example here right click on this one i'm creating a folder um what you can see xml files all right so if you want to place inside this xml file here so probably you have to give the path here you have to provide the path okay user directory okay system.user directory as well as you are to give the slash xml files okay like this xml files slash like this you have to provide it okay so probably you will be facing couple of more issues while confirming this better to place outside okay there is no problem with that i'm placing outside all right so it will be very easy so why i'm using this maven super plugin to run your mywine project with this particular suit file what is there in the testing.xml nothing is there right so because i didn't create anything in my framework so far okay i'll come to the testng.x simulator and come back to the test base right and here probably you added most of the things that i'm not most of the things the required jar files to your project you can start with your uh this one what is that your base one okay fine sir what is the base what what we create in the base files okay i'll come in here here in this base files basically configuration of your browser browses okay probably you can also create all reasonable methods visible methods okay probably you'll be creating reporting utilities reporting utilities okay probably you'll be using property readers okay i'll talk about the property ideas later probably you'll be reading the xml letters also okay so that means you know this is the base where you'll be creating the driver class and this driver class will invoke across all your framework classes this is very very important where you have to create the driver interface okay that driver object has to be created for the web driver and you'll be placing okay you will be you'll be uh creating the browser invoke related stuff okay you'll be invoking to the browser i mean opening the browser it can be chrome firefox ie or whatever it is and you'll be navigating to the particular website the demo website website and after that you will be uh using your test scripts and you will be adding your tests and you will be running that okay but configuration related stuff you have to place in the test basically okay because when you're running the project right okay initially it will come and stand in the test base the driver and the driver will come here and stand in the test base and is looking for where is my driver okay the driver will drive the all the steps in your test scripts okay so we'll we'll see one by one okay i'm creating an object here okay so what is the configuration of the browser here what is the configuration in the browser here so here what i'll do i'm creating an object and i'm creating a method for the initializing the browser okay all right so how to initialize in the browser here come here i'm creating a method public white this is a way to create a method right so here uh in work browser or we can say setup we can you can use anything okay invert browser and here here i'm adding the code okay the first thing is if why i'm using if condition because if you're working with the multiple browsers right probably you have to give the configuration proper configuration to the browser's tomorrow browser to browser so that is the reason i'm using if my browser if browser dot if browser sorry browser dot contains okay contains off okay chrome chrome and here is my configuration here is my configuration okay then health if browser dot contains iff r5 flux you can give any shortcut notions firefox and the proper the respect to cody how to give it here if you're working only three browsers right so probably you can end up with you know else block okay so here you have to write for the ie browser but where is this browser coming from okay so this is an object where you have to create it so here in the string browser i'm giving it this i'll be calling into my test script okay in my description when i call this invert browser is equal to chrome right so this particular block will be executed all right if my browser is equal to firefox this block will be exported if it is not both of them then it's gonna it's good the high browser probably will be working on these three browsers mainly into our um selenium automation testing right okay all right so that is fine um i probably have to do this all right all right so yeah fine all right so what is there in this particular one all right so when you're working with this chrome right it's fine but if you're when you you're working on the windows mission probably tomorrow you're going to work with this um mac machine so that is in that case it's going to be difficult to run this so you need to keep in mind uh saying that you know you have to configure your framework okay um based on your operating systems also okay so here i'm adding one more this one okay here and this one i'm probably adding uh we can say okay um oe start contains contains which dot contains here win shortcut okay i'm using shortcut all right so this case sorry if this is equal to this one all right so if it is equal to os dot contents of wind windows and this this block will be executed till here it will be executed and else else for the one else for the able one um we can say like this no shoes if else if else if of os dot contains contains mac okay and here you have to write for you know different conditions okay browser dot contains okay safari and here and else probably you'll be working for the chrome there itself okay not more than two brothers in the mac mission um yes so if it is a windows probably will be launching i mean launching these activities and if it is a mac then we'll be launching these activities but where is my voice sir is getting confusion right so what i'll do so this one we should not keep in this one in this particular method okay we should not keep that particular object our variable inside this particular method because mostly we are running we are running these things on the um windows mission right okay but anyway i'll give the best solution here go and create a properties properties in the sense you come here properties when it comes to the properties right properties in the sense you'll be adding the extra configuration related stuff in this particular configuration file so for that i'll be creating a file here com. what is that demo webshop dot config configurator all right here i'm creating a file called i'm sorry not class a file file where is the file here yeah i can see others file here go to file and here this is called config.properties properties okay do not think is these properties are related to the uh that web ui element properties it is a configuration related stuff okay example i want to get the browser name from here browser name is equal to chrome okay example os name os dot name uh is equal to um win okay um let's example username is equal to our kudikala password is equal to um some test one two three okay uh what are the things you want to use it uh example your sql server sql server username server server username is it called some my test db sql server password is equal to my test db one two three so that means you know whatever the reasonable data i mean uh these this is not go this is not going this is going to be changed okay but if you want to run on chrome browse uh firefox browser right you can come here and you can change the firefox so that your test scripts will run on only firefox browser all right so i'm using the chrome uh chrome only right now okay fine to read this config.property file obviously we need to read this one how to read this file come back to the test base public wide you can say properties function all right you know write how to read properties files property files how to read the property files so probably i need to write the code here all right so properties so properties what is it see java.util okay properties and your object name is called prop is it called new properties okay new properties new properties i'm creating an object for the properties these properties are going to read your config.property files so how to read that okay so for that so basically you might have seen that you know if you want to read the excel files or csv files whatever it is you have to use the file input stream concept file input stream concept in java is to read the particular files excel files or you can say property files those things okay so i'm using the file input stream concept here i'm sorry so that is the reason i'm asking to learn some java concepts fis is equal to new file input stream right new file input stream all right so this is the file name where is the file here the file is located here right copy this one right click on this one properties copy the location of the file copy the location of file double quotation paste here guys do remember see this one if i give this path right if somebody wants to use the same framework in their mission right this path may not be located because it is there in my c drive but if you if we if we uh import this project in d drive this path will not work so that is the reason i'm giving system directory path system director path in the sense you know it will first look for the director name and then after in the folders then put in the package right so how to give that you have to give like this system dot get property get property what is that git property and here you can use user directory user dot directory then after you can give okay so till here this means the project name will come in that what is the folder here plus till here you can use that see remove this guy make sure you have to give the double quotation guys okay double quotation is very very important read to read okay the path of the particular location file in the java okay if you're giving a single path right okay it will end up with error all right so i'm using this okay i'm reading these files from the particular location which location src is java and this webshop config and configure properties fine then after i have to load the property file prop dot load up particular file which files are your first file i'm loading it i'm loading it so then after i want to print this whether it is printing properly or not and whatever the data is in the configured property site this is printing or not i want to test it okay so how to test it you just you can give some you know property files property properties property i'm sorry property file data okay here i want to give some you know prop so prop is an object right this flow up object and it's loaded with the data from the config.properties and i'm just printing it whether it's printing or not all right fine but this is not the best practice not here to use it so better to use these objects okay these objects are the this particular method regularly so we have to make it as a global set cut this guy come here and paste here here prop okay and whatever the object you're creating inside the class right inside the method right guys please put it at the global level okay so that you can use um uh you can use across all the classes at the framework level f5 yes is that a phrase yes fine perfect all right all right now it's fine good looks good okay so probably i have to give the uh full access to these guys public static okay i'm giving the public static here also probably you will not face any kind of issues um i also want to use this guy for the static driver all right when it's come here here we are stopping here right where is that contains i want to see these os here if you want to read the properties from the config.propertyside we already get an object for this okay here come here um sorry is this okay come here system dot system dot system dot get property get property get property the last single string key and here you have to give the key see guys if you go to the computer property side the left side is the key and right side is the value reference is a key and right side is a value and keep in mind that you know which one you have to give here we are talking about os right where is the row is this is the key copy this guy come back here and paste it that means you know this value is when this value is when windows come here copy the same thing cut here paste here hope you guys guys understand right this property os dot name dot contains of windows and this code should be executed this code should be executed all right the same way i should do for this one also mac also copy this guy and paste here all right but what about the browser can i use the same thing for that right of course copy this guy come here come here properties and here double quotation uh what is this this is a browser name it's a browser name so guys it should be uh a naming convention uh i'm not gonna it's a case sense two guys whatever the name here right you should be same name okay should be same name same key value okay if you're missing calculator smaller right okay if you're giving wrong it won't work it won't work okay what about this one what is this chrome again don't need to worry about that copy this browser name here paste here run time it will check runtime it will check this one is contain the browser name okay right now it's set to the this one configure properties called chrome okay now come here um probably it's not required for this um is that required guys i don't think it is required for this browser level um like where i can use this browser then okay i can use the test level don't worry i can use the test level uh probably i can remove this guy right now i'm removing it i can remove a browser that contains okay because we need a configuration right so if the browser is equal to chrome so based on this only will come it will it will work all right um probably i have to give something here all right yep are some something coming here okay throw exception or sound yeah cut this guy all right so why am i using try catch here probably um no if the file is not find in this location right your configured properties it will throw an exception called as file not on exception so that you can come here and you can check the particular path okay you can fix it all right so we are done with the property radius configuration and then after we have to add the a particular chrome related stuff okay right now we'll go with the chrome only because uh uh writing all the code for the firefox and ibrows is gonna take time all right so first one we're adding some you know if you want to work on the chrome right so probably you have to have the system.set property for the chrome driver chrome driver okay this is outdated guys okay please do not use this guy please do not use it okay use the a web driver manager quantity so replace of system.set property use the selenium webdriver manager so for that you need to add extra jar fence okay come to the maven repository come here web driver web driver management okay just type here you see this web driver manager come here okay probably you can take anything 6 4.0 copy this jar file dependency come to the format example paste in event save it okay the jar file is going to download into the maven dependencies probably you can see somewhere else here web driver manager i cannot see that but it's still downloading sorry all right it's almost done all right yeah web driver manager probably is researched somewhere else i cannot see that okay you can go to the test base here if you're working for the chrome right okay you can use a method for driver manager control space series web driver manager dot which browser you want to work on it chrome drivers so chrome driver chrome driver enter dot setup okay so this is setting up the a particular system dot set property for the chrome driver okay you don't want to add any system reset property and you know adding the dot chrome down dxe file on all the things okay just ignore that and come here and add this guy and then after what you do you have to add the capabilities for the particular chrome browser right okay so in that case what i'm doing i'm using chrome options to set the arguments chrome options options easy called new chrome options options and here options dot options dot add arguments so here there are lists of methods you will see that here i want to add my browser should be invoked in the incognito mode okay if you want the browser to be in incognito mode like you know browsers will be open like this okay there will not be any issues in that this one okay all right so yeah come here and come here is that yes here incognito incognito mode okay all right come here and then after and try to create a desired capabilities for your browser desired capabilities okay cap is equal to new desired capabilities capabilities dot which browser you want launch it chrome browser right chrome and then whatever the browser you want to invoke right driver is equal to new chrome driver new chrome driver and here you have to add the caption cab voltage all right and probably you need to set this uh capabilities dot set capabilities because we use the chrome options right set capabilities here you need to add chrome options options dot chroma capability and the value is this option otherwise there is no link for that all right so something went wrong here that's not a problem don't worry about this guy all right micro done my chrome competition is done okay if you want to add for the firefox also let's add it first okay what effort and here same thing web driver manager you don't need to add any eco driver guys okay so for firefox you have to add a system.property gecko driver but that gecko driver you're not using in this one uh sorry webdriver manager dot firefox driver dot setup okay this is enough and then afterwards it you have to use um firefox right so firefox options firefox options and fp easy called new firefox options okay and here uh i'm going to add the location of the firefox browser so where the firefox is installed in my mission so here if you go to the c drive um c drive go to the program files and here you see the mozilla any mozilla is not there so probably you will see mozilla path here so you have to set that path here where string some path is equal okay string some path is equal you have to add the c drive mozilla path mozilla where the mozilla is installed information okay so for chrome is not required um probably you can give the path like this you can give it okay i can do something mozilla in my system mozilla is not installed that is the reason it's coming like this you can see firefox.com firefox.exe all right all right so now you have to give options that set binary i'm sorry where is that not options fp dot set binary set binary of this particular path so your firefox will invoke based on this configuration otherwise your file fox will not work okay driver is equal then same there is go to new firefox right new firefox driver firefox and driver all right so here you want to have firefox options all right so we are done with the firefox configuration also forget about the ig right now so taking a lot of time on this one all right so once you're done with this guy okay you have a basic basics base is ready for the invoking the driver now you have to come to the particular project okay here and here to create a test one right click on this one come back here package name package name com dot demo shop demo web shop dot test scripts okay test scripts description field all right here i'm creating one class that is called some example register register okay so in this my website uh there is a registration link i mean model is there i want to automate that okay so come here so any test scripts okay any test scripts should be extends within your base class because the driver is placed here right driver is place here you come here extends test base so what you're doing extends because we are using the inheritance concept to reuse the i mean reasonable purpose already the base class driver is created here so i want to use the same driver into my particular test scripts okay all right so now here you know right how to um write the test scripts okay so we have to do the testing g annotations here for example i want to use uh before sweet or before class before class and you should know the purpose of the before class and before studies you you just have to spend some time and to learn test engine concepts okay public-wide this is what i call is a test setup i called as a setup all right this is a college setup and here what is the setup setup is nothing but no this will invoke the browser browser from the test based class so how to do that already we extended the test base here and whatever the method see in this particular class that will come to the test base so how to do that where is the method where is my method here invoking method this is my invoke browser method all right so but uh invoke browser method is here but can we use directly okay shall i go and optimize something else here okay i have to auto optimize that so you cannot directly go and utilize this invoke browser into a registration class and registration class you just have to optimize this code a public wide okay here um i want to just create a method called invoke invoke here see guys when you're when you're when you want to invoke the browser i mean when you want to you use this particular functions from the test based right okay here the individual methods have been created for that properties have been created invoking the browsers have been created but when you're running this one when you're running directly here invoke browser invert browser of you know something chrome here okay this one is look for the where is my properties you're adding first you have to look for the properties you're reading the properties so that has to be executed first okay but without executing that why you are running my video browser where is my reference okay so that is why you have to create another method here and here i'm calling properties properties already i created here right properties this one i'm creating here uh create into the particular okay throw exceptions and come down here and here i want to use this one copy this guy paste here here i'm getting the browser right okay so what i'll do already create an object prop dot get property proper get property here also i can use the crop right prop not system.property prop and here also prop where is the system here this should come the property object only property object only it's not from the system okay property and what is the key name the key name is a browser key name is the browser browser name all right browser name it's fine two things okay but where we are navigating the url we're not navigating to any url so we can give that driver. get off url get off url but where is my url here still i'm having that so i'm going to the confirmation file because this url will be using this is a static one okay url is it called okay so on so url you cannot give any kind of hot date i mean hardcode in your framework you have to remember that you should not give any hardcode in your framework level okay save this guy come here and here same thing property dot get property double quotation url same name what is the same name url perfect come back here all right close this guy and after that once you navigate to urls i want to maximize it driver.manage.com window dot maximize it all right so that means you know first when you're invoking this method into your task scripts right data scripts right you need to use a browser here okay you're hard coding it that is wrong practice come here paste here enter so you are not using any data here just uh import these not input just throw the add the through exceptions right fine fantastic now if you go to this f3 okay you will see these properties first essentially it's reading the properties and then after invoking the browser okay navigating to the demos of url and maximizing the browser okay let's go here and we'll add one test here test okay test origin okay i'm not writing any code here i'm just writing some here successfully launched successfully launched browser launcher browser all right all right so it is launching the browser but how we are going to run this code is a question right we are using the test ng concept right testing unit testing framework of course we need to use testing.xml now now testnj has come to the picture come here okay here i want to write a quote how to write a code here see if you don't know how to write a code you come to google okay search for testing your dot xml sample okay so you must know the test energy hierarchy you know how we are to use xml tags and all those things okay just go to any of the website and copy the sample one i'll modify it all right so where is that my xml file probably this is the one um [Music] i'll copy this guy i reset copy this guy copy it uh come back to the use this one paste here okay i want to remove all the stuff that i want to i don't want it i'll explain you what uh exactly we are using it just just fine this also can remove it all right guys this is the testing dot xml very simple first into the xml tag this is xml tag the standards for the xml document okay the doc type we are using it this is the comment only and we are using this suit file okay first we have to use the suit tag okay in the test engine the suit will be executed first okay this we can say um test changes sweet okay ah this is the sweet before sweet and then after test will run okay here i can say um i can say demo shop test test and here you have to give the class name exactly what is the class name here register class right this is a registration class this class name you have to provide here in the test introduction copy this guy come back to the distinct.xml and paste here okay but if you're giving the testing.xml i mean the register class here right but how it will recognize where it is located is the question it is located in the form.demo web shop.telescripts.com test scripts in that registration is there copy this path you have to copy this guy come here paste here dot so this is the actual path this is the actual path here for your registration class com.demo webshop.testscripts under that there is a class tomorrow if you are adding one more test here login right you have to add login here only okay you need to change this file you want to change this one this is the static one and save this guy fine i save it can i run this testing.xml no because you're working for the maven project right obviously you have to run it from the form.xml so where is this where what is the link between format xml and testing your xml you have to link this session.xml into the prom.xml right go to the form.xml i already given a link here see here i already give a link if this is not there your testing the file will not be triggered what is there in the testing g the registration this code this code will not be executed okay we need to place the test engine.xml here with the proper name and you come back to the maven project okay we come back to the maven project we just added only you know browser launching activity right so now you can go and run this form.xml now is the question here how to run it there are two ways to run okay from this eclipse okay there are multiple ways to run the permit xml that is fine if you want to run this from maven project right either you go and right click on this project come to run eyes and you will find there's so many you know options here first you have to go and clean this project live and clean what does maven clean does a maven clean is going to clean all the uh all the even scratch scrap from the project what is the scrap the scrap in the sense is any uh already uh created dot class files all the gen files are there right in the project those will be cleared okay and also it will also download the pending jar files for example you added some dependencies here okay it is not downloaded yet so when you do the clean right automatically it will look for the all the maven dependencies been installed or properly or not okay so when you do maven clean it will clean the project and it also install the maven dependencies whatever you get here now clean is done okay you have to look for build is successfully done if your build is failing then you have to look for the error what is error you're getting in this concept all right now i have to go and run this project how to run it after maven clean right click on the maven project uh command x7 runners maven install there are two options a maven install on the maven test what does both both are doing the same job but when you go with the maven install right okay if any kind of pending jar files okay before running the test those will be installed pending jar files as i said before right maven clean same way if any pending is from the maven project that is going to install and it will execute the test scripts which you added to the testing.xml okay and movement tests also do the same thing but maven test is the primary target is to run your tests run your test scripts okay i'm going to run the maven install so maven install is going to execute your telescripts will see that see the pending language have been downloading right it's downloading that perfect see this the properties are anyway is uh reading you see the property names here what is the properties here you see the properties here no properties nothing there is a null point exception you see this null contract shift is coming so uh here the properties data you see this property data is reading properly there is no issue in that you see this properties data is perfectly coming so the next job is the null point exception okay guys if you are facing any issues right okay that is good for you because after fixing i mean after doing troubleshooting of so many issues you will learn a lot of things okay we'll see that just click on this guy uh i come here this is the issue here put this issue here go to console again come here null point exception null point action is coming and if you have any other tags here nothing is coming all right okay i'm thinking that this invoke one okay there is an issue inside that there is an issue inside that so what i'll do these properties i'll put in before switch so that means you know before class my before suit will be executed okay first this pro this properties will be executed and then after my registration class will be executed okay we'll try to do that or else we'll see for another solution clean it still have an issue still has an issue what is an issue exactly is coming here property is printing two times okay that's fine uh invoking is fine um same error no point exception know which so we'll getting to that null point expression where is that here is coming probably um once again let me make it in the public also all right so this is the one let me remove this it's not a problem all right so what else we have here um anything else we are doing here all right we'll do one thing after this guy i'll try to put browser name is fine go to the properties and check once browser name is fine chrome and here it will go to the this one and we will check for this one win property start bin and then after uh os dot name bin contains fine um all right uh okay i'll do one thing system dot properties system dots outline um i'm just thinking whether it is running fine or not um property is fine there is no showing that uh anything else we need to add here excuse me yep uh your voice is baking rakesh your voice is breaking okay um probably this desire capabilities to create outside let me see that um public um yeah cap so let me get a static starting is not required um okay let me do one thing this level i i'm just removing right now this level i'm bringing right now probably you know we end up with a lot of things all right so come here this is fine browser is record browser dock contains this one contains and chrome all right let's come here and try to look for this one change to access to the all right that's fine no shoes let me go and clean once again so these are the common issues that usually get it oh my goodness still i'm having something show you here in work browser in the info browser what is there here uh do one thing um running browser name in the invoke here come here closer name chrome and i'm thinking here only uh probably it's end up with this something else here um duplicated i don't know why it's duplicated fine come here clean this is fine or else probably we need to create another kind of anything here nothing it's not required uh say browser name it is not printing you see that browser name is not printed um sorry browser name here browser name chrome is not printing you see that browser name chrome is not printing here browser name chrome is not printing here have you seen that guys this is not printing right this is not the printing here browser chrome is not printing so browser chrome is not printing that means you know it's not getting inside this method it's not getting inside this method so probably we are end up with this property dot prop dot get browser name so if you want to do anything for this um obviously we're getting this kind of issues okay um i'll do one thing instead of doing this one i'll try to give chrome here browser name is google chrome if this is chrome contains chrome come here and execute this guy okay so i'm not using any properties here right now i mean a property file here probably that is error with the property file you'll see that cleanup and this time should we print the um browser chrome you'll see that i'm sorry yeah fine all right it's running we'll see so these kind of issues property related issues you definitely get it see it's not printing right so browser chrome is printing so the problem is with the which one so it's opening the incognito mode right it's opening with encoded mode and should maximize the browser perfect okay so there is an issue with the properties okay we'll fix that later um we'll getting into the first job i mean okay fine so we are able to launch the browser right we're able to launch the there is an issue with this properties probably it is trying to read these properties first it's unable to read that um it is static only there is a problem what is the problem here um public white i think this should be a starting method no do we think a starting method can you use the starting method for this it doesn't require it it's not required it's not recorded static method it's not required all right so okay fine let's okay we are able to launch the browser okay and we are have a basic configuration okay not the complete configuration for the test based level and now the actual context the actual test is started here here actual test is started see if you want to add any kind of properties or methods into the um this particular research class right example the scenario is you have to launch this website i mean you have to launch this website uh where is that launch website yeah come here not this one you come here you have to click on this registration link and you have to add all these um properties and all the things first you have to take the properties right you know how to take the properties on all those things copy right click on this one inspect element okay um here this is the property okay probably you can take right click on this one copy xpath okay ctrl f and see that this is a long x path this is the relative x path so this is the absolute x path don't take that absolute x path try to take the relative x path okay just double slash star okay and go to the inspect the element and here we have our different things class is equal to this one right class is equal to come here uh at the right class is equal i'm sorry the class is it called quotation quotation perfect it's recognizing how many elements are there only one element copy this guy okay paste in notepad okay don't place somewhere else okay paste in notepad okay this is for register all right now i'll take the properties for all these elements i want to click on this mail button copy this guy come here and this is the id is there right copy this guy when you have an id or name property right so don't take the xpath guys okay i don't prefer that i don't prefer when you have id xpath you can go on the use that at particular only we have an id id is there perfect go with id if you don't have idea name properties or class property you better go and use the xpath okay id only all right so i'm going to use the first last name also what is the last name here is the one all right so last name is it called id perfect uh the other ones here what is email address copy this guy and uh photo for yes all right so email this is also id all right and the password we have id yes password is id is there password this is also id all right so go here and take this guy id yeah so we have almost i all ids are there for all the elements click on the registration button click on the registration button i think yes id also is here copy this guy paste here all right fine so we have we covered i mean we collected all the ui elements for the registration screen right okay but where to place these things so we talk about when you talk about the different models or screens right okay in this particular web applications so we already discussed you know when you have a bunch of screens or models in your web application better to go for page object model implementation that is unpatted right so how to do that so for that page of this model implementation you go here and you create a new package for that new package for that what is the packet insert com.demo web shop demo web shop dot page you can give it a name page library or pages or page factory okay you can get anything based on your understanding purpose pages i'm giving it okay pages or else you can also give up screens also it's not a problem so here uh instead you know just creating a friend you know i'm creating different kind of pages here like you know registration page register page okay whatever the name is read please follow the naming convention here okay the name the same name register and after that you have to give the page finish it up and i want to create another page also login page login page and any other page shopping code page also is there if you want to create that you can create also that okay create um shopping cart shopping cart page okay so your class name should be ends with the page so that we recognize that okay this is a page class finish with that perfect now when it's come here registration page what to write here what to write here see we are going to write all the page i mean um ui element properties this particular page your element properties will be placed in this particular instruction page okay so how to do that very simple so first how to create the page there are two different kind of concepts when you're using the page object model concept okay page object model page object model model you will see two different things one is um all right so one is page object method and second one is page factory see they are calling different different uh concepts i mean when you come to the page factory that the coding concept is different guys okay when when you come to the phase factor the coding concept is different and when you go to the page object method and that is completely different okay so we are going with the page object method okay um so look like same not same basically the the structure will be same that uh what we can say uh whatever the functions or methods you are using that is different okay i'm going with the page object method only okay all right so how to do that see first one is the registration link right this is a link okay so for that you have to create an object for that buy buy is by and what is that name register link is equal by dot what the property you are taking expert i have taken expert i have taken double quotation and give that text path here copy the six part okay copy this six path and paste here done you're done with the decision object recession page object and okay the other one by and what is it um gender this is called gender gender is it called by dot this is expected here taken you have to take an id rate you can use id id double quotation we can give you that this is for mail right you can give the mail this is called a mail mail all right gender mail so by default i think gender mail is selected um oh it's not selected sorry go here click on this guy nothing is selected here fine and next one is a first name come here okay i'm just you know cloning these guys cloning just cloning it control uh alt down arrow cloning these guys is the first name for first name first name this is whatsapp text box okay this is a last name text box this is a email text box i'm going with other one password text box pass txt confirm pass txt okay so that means you know this property is related to the text box property okay you can go see here also radio button rdb are radio button rate rdb rdbn okay now you have to provide the robot properties here paste here first name remove the space here sorry last name come here paste here all right password confirm password register button all right this is the register button this is a btn okay it should be you know the different name for this link and a button okay you must be careful that okay all right so we just created only objects for that particular ui elements right okay what what is actual implementation to click on this link what is the actual implementation for this entering the data in the text box okay we have to write down here okay so this is the actual implementation for the um you are once again public what enter or else click register link register link okay i'm creating a method because i want to perform an action on the this particular ui element registers link okay come here and here you would write the logic driver dot find element find element you see nothing here but you write the code right driver find element and that's property how to give it okay so driver is not able to find here so for that you have to create a driver object here driver object here all right driver object i'm creating it all right perfect all right come here driver dot find element and already taken the property right here copy this guy no need to uh buy dot find okay just come here and what is the operation you want to click you want to click in spawn perfect so that means i'm going to use this i will implement this function right so that means it's going to click on this particular element okay clicking on this element now what are the next operations here public white click gender mail okay all right so uh same thing copy this guy driver.find element member.find element okay and where is that uh gendermale yes your gendermain and what is the operation you want to do is a click operation perfect and what is the next set i want to enter some data into the text box first name probably white okay enter first name enter first name right enter first name here driver dot find element first where is the first name here first name dot send keys okay here you have to enter the value but we are going to give the value here that means in your hard coding i don't want to give the value i want to pass it from the my function that is called if name okay you can give any name no issues okay it's f name at runtime i'm passing from the test script not from here okay do not enter any kind of hardcore data in the page level do not give any hardcore data that is very very important guys copy this guy down come down this here can i go with the enter last name here last name um let me could i say l name here this is called name probably have to change this guy also last name last name and i want to enter the email also copy this guy if you want to work first enter email enter email okay this is called email okay guys when you are writing when you are creating these variables right i mean for the data you want to enter into the particular method okay a particular statement make sure it should not be same both above created objects and this values it should not be the same okay if you're doing that mistake right definitely is going to fill this particular function okay like example if i'm using uh email right email example email next i'm using it okay same thing i'm going to use here okay so it is not going to recognize this particular this one it is going to recognize this one okay please do not use the same name that is a very very uh important we have to follow the some standards um probably i have to change here right email all right perfect uh let me do it for further foot all right all right um all right so password right enter so uh once after finishing this uh page update uh uh this business page class uh has a couple of questions guys i mean you have any questions you can ask this is called password and this is called password and this is called confirm password and then after i'm gonna enter some value i'm gonna click on the button right click on the button copy this guy come here paste here click register button register btn button okay you can give like that also no issues register button all right perfect click operation it's done there's any questions here please uh please be to ask me we're getting into that natural thing okay sir we need to change the oh yes sure right perfect perfect man thanks for that um password uh confirm password confirm password txt all right it's a wonderful man okay so any other thing guys we've been stored here i hope this is fine right this is fine so we are done with the page objects for this particular screen and also we implemented a particular page of these methods to perform an action the page right so this is the page or that factory that you created i mean page object concepts you have created for this particular registration screen nothing is there in the registration screen that you have implemented all right okay so probably if you want to value this registration label also if you want to do that you can do that no shows so probably you can go here and come here take this one um right click on export probably can find the good one no i cannot um can i use this page title probably uh copy this guy um double slash start and also guys you should learn some uh customized export concepts here it's very very important how to do the customization header one i'm not uh what is this oh that's fine no shoes do inside that i can find h1 right yeah perfect perfect copy this guy come here i'm writing one more object called as buy what is that register label or else we can say header1 is it called by dot x path double quotation this one all right perfect guys do remember one thing so this is anyway you can go and create it but what are the the other requirement that we're going to create for the particular page say whenever you created a new page right okay by default you have to create two different methods that is called public public string get get title this is very very important every page should have a title list written driver dot get title this is very very important this is very very important every page you should have a title because you have to verify the title name before launching or before landing into that particular page and also if you want to verify that the particular url so you can do that no choose get current url currently url page perfect return because i'm retaining some string right driver dot get current is url okay you see this this function see this function is reading string okay this function is written in string that is the reason i'm writing this string value here okay you should not use any wide here y will not return anything you have to give the string only okay get title and the gate url currently you are returning the particular string value okay get title and get current page url so get current url get title page you have to use it for all all the pages across your framework that is a man entry guys all right perfect i'm done with this i'm done with this page and what to do next i have to come back to my page here okay so here if you want to use this particular registration page into my test scripts you want to do you cannot extend that because already extended the test base okay the driver is coming from here you have to create an object for that register any other class take any other class in the page uh object class or any other task that you created you have to create an object in the test scripts okay should not extend that okay we cannot we cannot extend multiple classes into one class okay all right register and this is where is my register here here is my registrar's uh registration page sorry registration page okay and here you have to give the object name register page register page okay so where you're giving the reference object for that here in the invoke i'm giving a register page music called new register page fine sir but can i go and use this web registration website um registration page methods in this into my test scripts let me try with that notions we'll get up we'll get an error i want you to find it okay all right so here i'm calling from the i'm calling the registration page dot first what i have to do sir what is my scenario i want to click on the link set what are the links a registration link right click on register link register link this is for click on register link click on register link and what next next one is click on mail radio button mail radio button what is that register page dot uh click generate click gender mail all right and this is what the page object model concept and then enter first nature enter first name uh register page dot enter first name enter first name okay here i'm giving statical right now i'm i'll be implementing the data provider later uh we're doing how to call data from the data from the excel file that we do later okay first name i'm giving statically here ramesh um okay register page sorry last name last name register page dot last name you have any questions so far please feel free to ask me email any anything all right so password and register page dot password what is the password here password password test one two three and your password and confirm password both should be same right okay both should be same here and it is for confirm password i want you to find out the issue you guys have to think about it you will get an issue when you run the script we are missing something i'm expecting to find that so click on register link this is a button i'm sorry register button right register button so register button uh click on register button perfect so i'm done with this i'm done with the test can i go and run it okay so it's going to click on the first you know this particular link okay and it will open these particular page okay and if you want to verify the title right something like that okay if you want to verify the url title okay you can use this one okay first okay anyway we have written the method right we have written the method uh where is that um string okay string title is it called okay what is the title we are giving here um registration page dot get dating okay title will come here store here okay and we will use the session right i set it set to dot asset equals asset equals okay where is the string here with the string we look for the string only uh here is the same okay here what is the actual here actually is coming from the side um the running website and what you're expecting said i'm expecting the title from the browser let me go here right click on the website view page source here you will find the title right copy this guy or else you can see you can focus on this one focus here you see that title demo space web shop dot register paste that also anyone you can take it if you want the proper name you can come here i can take it perfect all right okay so fine um setting the title just quick and then after entering the data clicking on the button um enter the this one first name last name and this one fine no choose now we are going to run this file we'll see that we have before that we have to check this class is placed in the testing dot examiner copy this class testing dot xml registry is there and we have to check the testing dot example in the com.xml is there now save all the files here right click on this one brown is megan king still you didn't find issue right click on this one maybe when it's done will that gonna work will that page clash i'm going to work in my test scripts we'll see the error message first what kind of error music engaged maximizing the browser is it clicking on the register link no right it's not clicking the wrist link so you see that build is failure build is failure we'll see that null pointer exception will go to the registration you see this in the beginning only it is failing you see this in the beginning it is failing why because right now the registration and our test script are independently created you go here it is not recognizing this registration diver object registration driver object so we are not i mean that means you know whatever the driver is coming from the test base right okay it is not equal to this particular the registration driver object so that is the reason we have to get into this class registration class we have to create a constructor for the registration class every page class should have the constructor you see this concept here constructor and here we have to create a driver object here driver driver and driver okay and here you have to use this dot driver is it called driver so this driver is indicated to this driver and this driver is dedicated to this one okay when it's come to the test drive your desktop right here it is asking for what is this i'm sorry um yeah implemented all right so there is some issue we will fix that no shoes and here is come to you what is this man okay let me fix this guy um common issues that's the common issues all right you see this here it is asking for the driver here driver see now this registration page is having a driver if you go on the f3 right it will directly navigate to test base you see this test base that means you know at runtime it invoke the test based driver because the driver is from here only the driver is driving from here only so that is the reason we have to create a constructor for each and every page class now we go and run here so now there is a link between your test scripts and page and test base so browser is launching see that is entering perfect done my test keeps getting passed you find the issue right that is the problem okay bill is fast and test run failure zero error zero skip to zero all right this is the one fine now i want to see the report sir where is my report see basically when you are using the testing as a unit testing framework for your project right okay testing the inbuilt okay test engine itself is giving one kind of report okay if you go to the refresh the project refresh the project and go to the uh target folder um we will show you i think basically it should come to test folder here it's not coming here i go to the surface report and there is emailable report right click on this one so this is the one this is the one testing this would okay that is coming here pass if it is failing then you know it will give the failed red color it should be it will be in a red cloud okay that particular function or that particular particular class or you know method it will show in the red color okay how much time it is there no way at what time started and what is the time four thousand millisecond that means you know four four seconds okay it is complete in the four seconds only okay not more than that so in four seconds we completed one script okay so total time for the um launching the browser navigating to url uh verifying all the elements and filling the data into the registration screen submitting the data so all the thing it will take it has taken fifteen thousand ninety three milliseconds that means you know fifteen seconds fifteen thousand nine eighty three by thousand okay thousand one one thousand milliseconds one second right you guys know that perfect okay we have a basic thing is ready right now but we are worried about the report i don't want this kind of report here class customer doesn't like it okay i want to implement that extern report so when it's come to the extent reported obviously you have to depend on other third party kind of tools and softwares so we thought that you know we have to implement this um extent report is a reporting tool right so we are going to implement that report so if you want to implement that extend report in your framework okay probably should have that kind of jar files okay go to the pump go to the pump here check for the exchange excellent report is there here extent report is there here okay okay so uh i think one second let me use the old one um because i have to go the uh relevant course and here i want to use extend reports fine and the uh this one is a two point four point one point two and so it's reset control yet but two point four one point two so right now is a four version but we are using two versions these methods are different and the latest one is a different one one second what is this what is the problem relevant relevant is this one relevant course perfect uh what is this relevant relevant codes i'm sorry this is a small letter i think extent reports i should work now i think okay why it is not working the reason is let me comment this guy let me comment it okay let me comment it okay when you're changing the version of the particular jar file or dependency in your particular format xml lite so what you have to do you have to go to the c drive first okay go to c drive and here you have a folder called as user folder okay and here then your with your name there is a folder i'm a system name my system name is alpha and you will find a one dot into folder here okay inside that there is a repository see this repository is whatever the jar files have been downloaded as part of this particular project right the maven dependent chart files all these have been downloaded in this particular folder just remove all those things because when you're changing the version right you have to remove all these things because there will be a compatibility issue with your different versions compatible issue will come okay previously the latest version has been installed now you're trying to use old versions so in that case definitely look for there is a compatibility issue inside that so i want to re-delete this guy okay fine now i want to uncomment this guy i'm saving it probably it has to be installed now um okay just look for the jar file it's not sure it's downloading anyway this would take some time sure i think it's yeah the meanwhile you know if you have any questions guys you can ask no issues okay any questions any questions related to the framework that we have been designing anyway it's getting late that's not a problem we can spend another 30 minutes or 40 minutes yep one question from my side yeah during editors some letters are reflecting in the blue color some letters are reflecting in the red color any what is the main main difference where you see that where you see that in this are you talking about formula order no not not xml file here here in classify yeah in class ones right here is the one so these these means you know we just now deleted the all the dependencies right okay so it is looking for the particular uh um imports of the particular jar files okay so once all these are been downloaded so then this error will go on this address will go on so this problem you know uh they don't have i mean it doesn't have the particular jar files in your in your project that is the reason i'm giving an error okay why because i'm just re-downloading that i'm re-downloading all jar files so once you're simple this is running first time huh okay so when you delete the jar files from the particular dot m2 repository folder right so it will look for the where is my dependency like you know we have imported from something here right this open queue on those things okay it doesn't have the uh the project is now it doesn't have the jar files so it is downloading once it is downloaded then this error will go on all right i don't know why it is taking this much time should not take it i should connect it to some line otherwise um this is on wi-fi i i think it's almost done 100 done i think i have to go back to my this thing um probably yeah we make sure that there should not be any errors in our project with this errors there should not be any errors so then only we can start with other stuff uh guys let me know if i'm if i'm too fast okay because uh the time is very less right so we have a limited time yeah guys you see there are no issues in this framework right now okay yeah what is the uh duration for this what is the plan of agenda for this one the agenda of this one actually we have we wanted to finish in two hours okay but initially we spend uh most of the time in these basic things right the setup in this and the uh softwares and all the things okay if we directly start with this frame but you know we can finish in two hours okay so probably it will take another 40 minutes okay all right so i want i want to print the um i want to impor what is that um generate the extent report so how to do that where to create an object for that okay so the first thing is known this is the test based right where your driver is calling from here where your driver is calling from here so for that you need to create a static black for the extent report why is static black do you have any ideas for the starting block code for a particular class or here i want to create a static block okay example in the beginning okay in the beginning i want to create a static block here okay example here static here on the gray start black why any idea guys any idea because at runtime yeah it will retain uh your stuff actually like whenever you mention something under the static it will retain its own capability um that is partially answered uh let me answer to that static plus why you are creating the static blocks we mostly uh don't do the static blocks when you're working you know when you're working daily activities right example you're creating test scripts okay probably there won't be a chance to create a static block in your test scripts okay you always use public wired and you know private wired or something like that you create a method and you create it logic and you finish the test that is what you're doing it but when you're creating the static right the static block will call first before calling any method in the particular test okay before example i'm running from the formula xml right first and foremost thing the static block will call what is there in my static block i want to run that first then only i can go and run with other stuff invoke method or some other methods okay it won't run if even though if you give this invoke method as a first priority in your test website okay it won't run this invoke first it will run the static block first it will run the static block and then only it will run the remaining methods even if you give the priority also it will run only starting block first but what you want to give in the static glass very simple before running my project or before running my test scripts i want to load with my report i want to load with my report capabilities what kind of reports are see i already started within the extent report right extent report will be creating an extent report object here extend reports and here i am giving object called as extend okay there is one more thing called as you know extend test extent test accent test this is second given the test object there are two different objects for that right so i'm giving you the public anyway i have given the avoid the static rate static cable the same thing i am giving this one basically you should not use all as a public static okay in your framework level you should make it as a protected as a bus driver because nobody should go and override that okay if you're giving public static right nobody anybody can overhead it and here i what i want to write it here i want to write um the extent report uh where i want to regenerate the action input okay extent extent is equal to extent is equal okay new extent report new extent report here you will find the path here you see that path extend report path excellent report path where you want where you want to use that password um can i use the ghee's test report can i use this one copy this path copy this path copy this guy uh do one thing here this path is not equal complete path is not required because we are going to use the custom directory path copy this guy come here and paste here okay but where is the system directory path system directory pattern since this one system dot system dot what is that get property sorry get property get property and here you have to give user dot directory okay then you have to give the path here sir it is the path here or i'm getting errors here okay find those shoes we will still have this thing okay fine we are giving the path here right extend is equal to new directory and uh okay i'm sorry this is i'm have to close at the end this one is fine here the bracket and this bracket is closing at the end fine report here okay fine the report is going to generate here but what kind of form do you want to generate you want to generate the xml format you want to generate the html format okay that that file you have to give here place place double quotation dot html file okay but what is the name of the file you want to give some name right basically you know what we are doing uh your real practices in our company right we are giving some date data time date of the time so every time when you are running the um script right it will create a dot html file with a particular date and time date and time example i'm running at 11 16 7 5 20 20 11 16 so when you run the code when you run the code it will generally report uh report 7 5 20 20 and 11 16 when you run second time it will execute 11 17 11 18 so so that you can go here and you can check you know what is the latest report with my day with your time okay so for that what i'm doing i'm creating object called as calendar object to create to print a date object okay to print a date object create a calendar dot get instance all right this is an object for that okay so this object um oh i want to create a date format right what are the date format simple date format simple date format okay and this is called formatter is it called new simple date format okay and the pattern you want to do that what kind of pattern do you want i want to do that i want to pattern called date underscore month underscore year underscore hazards underscore minutes underscore seconds why i'm giving seconds say example if you're running if you're running back to back in the same minute right probably it will it's go it's going to override with the existing report probably it's going to override with the existing report so that you don't have to track a previous report right so to track up previously put i'm giving it the seconds also seconds anyway change right seconds will always change so here uh in the report i want to add that so how to add that here uh come here system directory okay and this is the path here and here i want to add that i want to add formatter formatted dot format of that particular date what is update sir calendar update which is current update dot get time so get time get time um sorry i want to close this guy here yes okay and after that please please i'm sorry inside the place yes please okay so here here test report right and first you will come with the date okay date date dot html this date dot html shall we give some name here shall we give some name here example i'm giving something called as report report report some name here fine and can we okay so there is one more object here the greatest of false excellent report and i have a boolean you see this replacing existing one why i'm giving the the boolean files replacing existing one you want to replace that existing one if it is a true it will replace if it is false it will not replace it will create another report okay you have a previous version of tracking all right i am calling i'm loading my extend report at the time of running with test scripts at runtime now i can use that how to use that how to use these objects now come back to your descripts the test scripts where is that the test script so i mean excellent objective in the test based right the test base is already inputted to i mean extended to my test scripts here i can create an object here okay here if you want to create an object to be your particular test website you can go and do that like you know test dot okay sorry test is equal extend to dot okay extend dot start test start test double quotation double quotation and here you can use uh what else you can use you can use something else some dc 01 underscore this is called verify register verify demo web shop register okay proper name uh with the valid data with the valid data okay and same name i'm giving it not a problem for understanding for reporting purpose data all right so this is uh creating a label in the report only label no no no particular thing that i have been created only label is getting it but if you want to create a logs in the report what you do you come here tester dot okay log okay log status dot pass okay and here you have to give it whatever the logs here okay here uh click on click on register link register links here okay this is printing the logs here okay all right now come here and go to the next row this is printing the uh title here get the title get the title set please you can give probably this one you can give here got this guy and paste here copy this one paste here title okay get the title else title is the title is the title is all right now next one should copy this guy okay for the same time saving come here paste here this is the one to click on okay click on gender mail gender mail all right now next one sir copy this one and here okay paste here and this one entering the data enter data and then uh enter first name it enter first name first name eyes okay we should not get the static data here because it's going to be changed so what i'll do for simultaneously i'll be creating data provider so that you can understand clearly here whatever the data is required to a test method you'll be clear you'll be creating different kind of variables in the particular method uh here what i required i required title i required title uh that i to capture from the excel sheet um probably that's gonna take time i'll do one thing that's gonna take time ramesh amish all right copy this guy first we'll see the report and we'll go and implement that it won't take much time our and copy the same stuff you want to see there the look of accent report email copy this guy okay so this is the static data we are giving it okay this hard coded value you should not give this this is not a best practice that you have to do okay um all right next one password password the password is just one degree copy this guy paste here and this is for confirm password same thing and the other one the register button click on the register button click on register button perfect okay now let me go and run this guy and check the report first right click on this one clean anyone is fine i think i probably should change one thing stop it i'm just going to stop it because already the email had been registered right so let me change the email right here i'm giving something else here um give me something else here all right so we are getting some errors here right so just have to change this jdk this is the common issue which we get every time all right so let me go and save this guy and clean it every time you have to clean it guys because the previous dependence on previous compiled classes everything will be placed in the project so those i'm cleaning it before running for the next first run oh there's a lot of dependencies here pending differences right my test is running here perfect need is running all right wonderful okay we forgot to automate this log out also but there's fine issues and our primary thing is no to generate the report right okay i know this report will not generate okay we made a mistake if you go to the test report right there is no report here because we are creating an object for that and we are writing the logs but finally we are not pushing it we are not pushing it so what you do at under the test script okay we have to do after class will be implemented before class right here before class and after class after executing the class what i'm trying to do is publish public word close close browser okay here i'm writing okay whatever the report you're doing right extend report extend dot flush it you have to flash it otherwise you will not push the report into particular html file you will not push it you're not pushing it so you have to push it and after that you have to end it end test you under test okay so my test is ended after that if you want to write to any uh unlocks right it won't print okay once you end the test it won't print any locks then i want to close the browser also driver.close okay if you have multiple uh browser instances you can use driver quit okay but don't use the driver kit driver.plus is enough right now available it i think you used the same email id one more time i'm sorry i'm sorry i'm sorry i made a mistake i made a mistake so we should give the random email give write a addre for the random memory so that um um next time you need to change it right you don't need to change that next time so that kind of thing ready you have to create in real time you have to get random email randomly uh you have to create a random email function in the test base and that you have to call in your test scripts okay not test scripts in the page level in the page level you have to call that not the this one so with runtime it will create you know some tested and then after you give you have to give it some number random number okay so that there is no confusion so for that we can use something called faker class it's not faker class you can use the random classes right you can use that random random some random of that is called function yes that you can use that okay all right done so probably gonna go and see that you see that um still not it done perfect all right let me go and refresh this guy refresh it i do not see the test report here probably it's gone somewhere else config no where i can see that report here where is the report here this path test report should come to the report folder only it's not going there any other things we are missing here guys check ones um do we we're going to refresh i'll not refresh it i've already refreshed it but it's not coming here um target folder no way um you're doing a mistake here part is fine user data is fine just report user directory plus test report r okay probably i should use slash here some slash all right should use a slash here i think this is not able to find in this report right folder is not able to find it okay i'll do one thing i'll remove this guy this guy um [Music] i think this is a one i think slash it okay because there's a folder path right okay it's a folder path that it's looking out for um after the directory okay let me go and run it once and before that i'll go let me change it let me do one thing man um go to the test page there's the test space here i want to create a method called is uh public white her random email okay random email i'm gonna create it we have a random function right random um or in this run is it called around is it called new random function all right um inter um length is equal round the dot um do you have a size unit when your size next no no no no no no can you have a size here um how do we do that [Music] and second random random number another number is enough random number is enough and the number to deter using java come here okay so this is the one i'm sorry we have this right so random dot current dot next next table what is that probably this is enough this is enough the range is enough range is enough all right i'm sorry sorry copy this guy i'm sorry okay so internal music called okay and the rand dot what is that next hint of an extent of the bound okay so what is the range you want to give it i want to give a three digit number three is it a random number and here um what you to do here this is the string string email okay email and then i want to written something here okay like return not written here once again let me write it here um email uh plus email place and your number okay number all right place double quotation etherit plus double quotation gmail.com okay gmail.com so this i want to give in the string variable string variable string variable string email text is equal to fine um i'll do one thing i want to make it this also a test okay so that i can give email this one all right and this one is going to be written string written string here come here written email which is fine guys i can remove this guy right right so here what i'm doing i'm creating a number here okay every time it will create a three different uh digit number it's a one two three four one two three or two three four like that so it will be different test two one two three gmail.com okay so just copy this guy and go to the registration not registration your page your page where is your page here um email email email here is my page okay you come here uh probably i need to create an object for that test base i have to create an object test base customers ebays because it is in the test place right come here where is my this one email uh here is my email sorry yes um example tbs dot random email um why i'm giving this guy this is not required right this is not record i think come back here probably it is not required this one because if you are giving here again you have to get the email over there so string this is enough all right come back to here probably it's not required and whatever is there here and put it in the string string email is it called or else email is equal this email is equal this email and copy this email in here perfect now you come back to the registration page probably you will need to give a email here uh here when we are doing mistake send the keys oh i don't think it is required buddy i don't think it's required i don't think it's required i don't think it is required because you're giving random email right come back to this one you need to give it perfect any convenient here guys no rage simple i'm just getting the random email and putting into this one new variable and calling this into the my task method uh test statement okay right click on this guy call this guy okay i have to run this tie we change everything right test-based extend report on all those things probably doesn't require oh it is getting failures something went wrong our email is getting failed uh null point exception okay probably it is coming from the uh this one right test base right probably it is that uh issue i'm going to use t base directly test base instead of using that it should be static oh i'm sorry if you go to the test base here probably this should be static here starting now you don't have a shoe here i have to remove this object because the driver will be overhead and right the driver will be overwritten in the registration page as well as just base so that is the reason i'm just using directly um right click on the sky nice living clean my even test i think this framework implementation session would definitely take five hours minimum five sessions so setting up everything will not even complete it off i'll see that you see that 976 perfect hey we got a report man you see that secondary product is coming 36 right click on this guy open with web browser if you want to open this beautiful report even you can the browser copy this guy and open the browser so that it has a good look see these are the steps that we have uh you see this is a label this is the label of your test uh class okay your class okay we go here uh this is my registration class you see this this is the one okay every function you are creating a new label here left side okay that's right uh example you have different scenarios guys okay uh verify the registration with logarithmic data invalid data okay some of the data all the details uh labels will be placed here and right side is the logs click on the register link title demo web shop vista is printed fine click on the list gender mail first name is ramesh if any of the step is failed right here any of the strip is fail here it will show in the red color it show in the red color okay so actually what is the limitation what is the um what will get the more benefits from the extent report so you can also capture this screenshot uh and embed into the test this particular report you can also embed that report i mean not to put a screenshot screenshot of failure okay so that is another level okay that is completely um included in the listeners concepts that is a big concept listeners probably we can have another demo for that okay so if you want to um embed that particular screenshot at the time of failure in this particular report right okay if you have to use the resonance concept there you have to embed your screenshot okay as when the test is failure so this is the basic you know extent report that you can do that and you can also modify whatever you want to do it i mean example left side i want to do it for actual value right side i want to do it for you know expected value you can customize your own okay but you know you have to write the logic here inside here logic here you write the logic at the um test based level or you know your registration level okay so this is what you know i'm telling the basic one guys basic one so basically we can also customize this particular now where is the page customize this also you can also customize this one okay every time you're writing you're writing driver find element driver fundamentally this is not the best practice this is not the best practice but what is the best practice here very simple go to the database okay here what do you do just give me a second so we are going to a reasonable method here public word in the test base public white okay see look up there first you know what kind of operations you do in the computation basically click on the buttons it can be radio button link or normal button or check box okay so for that we are writing logical click method click method the click method common method we are using everywhere so no way to use only driver.find element okay we are writing only one place divided by one element okay so this method we are going to use everywhere in the ph classes so how to implement that very simple one guys so here in the clip method what you have to do we have to call uh different different objects webdriver driver okay and we also use the locator what kind of locator by element locator locator and what is the value you want to reach so any value you have to give it you are not entering any value right i am not again entering any any value so that is the reason i'm only go with these guys so here uh here you have to create a web element here web element element is a called element is equal driver dot find element you will see only here live dot find element here i am using element locator this element locator will be giving at the page level don't worry about that copy this guy i'm customizing this okay instead of writing the length of code into my this one driver.finding my driver fundament this is not a best one i want to do it more you know interesting way so how to do that here if i'm just using the condition ele dot okay if that element is displayed sir if that element is displayed please go and click on that please go on click on that go and click on that then after i want to print a log sir here i'm printing the log i don't want to print the log into my test scripts this is the clumsy rate writing the logs for each and every step is not good practice it's not good practice don't give that kind of things okay i want to customize it come back here this means here log status dot pass okay here i want to give something else here what do you want to give sir here to verify to verify the verify um user user able to click on click on so also elements are what elements are the element name show to provided here sir okay let's example it is a registration link that you have to provide here name okay i'm just giving a name sir i'm just giving a name here name comma comma okay and you can also use um okay click on element right okay comma and then name okay name then here double quotation clicked successfully successfully okay so by this way the report also is going to change guys see there are two things first left side is going to create to verify the user able to click on a register link register link click successfully okay in this repo you will see different manner what is that uploading where is my report here see here it is coming only one line right you will see two different lines over there first actual then after expected okay you come here and put in the logs here and then after okay guys don't forget to mention that you know try catch black for this because because you have to see the proper exception for the particular click and enter text operations what is this guy yeah just copy this guy fantastic now come here here tester dot and here log status dot fails up it's not a it's not a pass because cash back always fail right cashback always fail so to verify to verify guys i'm boring you it's not right name verified to verify registration link is visible or clickable clickable in provided time so basically if it is not uh visible in provided time so it's going to an exception saying that your element is not visible an exception occurred an exception occurred occurred waiting for element waiting for element okay plus name which element name register this is the name example okay uh to click to click okay this is another kind of no configuration guys now you come back to this registration page set registration page where is the click operation here here is a kit coverage right it is a condition you see this okay click operation click see click you are not getting here why because it is in the test base test base dot click what is click click is not here so you have to make it as a static that is the reason your driver is your driver is a static one that is the reason it's come out come you see this clock kick is coming right kick is coming now here driver okay driver is which driver registration page dot driver or else you can give driver here that's not a problem driver now what is the element locator element locator is there right this is the one so this is the one registration link copy sky come here paste here what is the name set again here is a new structure is coming this is called a new implementation okay name of the each element name of name of each element element element so for that you have to give one string set string registered link is equal here register link link this is another new concept okay so each and every element name you have to give it so there is something duplication okay here you have to name call there is something called a name okay you can give this standard name okay name is nothing but some name you can give anything but it should be standards okay if you're giving another name right example string string um what is this generic gender mail mail name is it called mail mail okay so come down here here register a name all right and remove the second element now you will not see any driver.find elements here now you will not see any diode find element okay now you come back to the other one and check you have to change everything otherwise you cannot run the same single one okay this is also click right this is also click copy this guy copy this way remove this one enter and here you have to enter the register i'm sorry register link or not sorry gender rate gender gender gender main button mail button and here you have to give the general mail uh nm this is the property of the element this is the name of the element okay why are you doing all these things this is for only reporting purpose it's for only reporting purpose okay a putting purpose and also we are eliminating the this driver.find element everywhere right it's not looks good so that is the reason i'm eliminating this this one test base test base dot this is enter right so again we have to create a reasonable methods here public white okay public static point starting white okay uh enter text enter text is a common for the entering the value in the text box enter text okay see what is there what kind of elements here driver is there locator is there name is there but one more one more thing is that that is called value value that you have to enter into the text box or edit box same thing is there okay you can also copy the same thing guys copy the same thing okay paste here but before that you have to create a tricast block right come here try catch block paste here okay enter all right if it is displayed here if it is displayed what else you have to do here um anything we are missing here what is this um this one is this one fine okay uh this one is coming the bottom all right uh what is this okay fine then element dot first we have to clear the data in the text box whatever if previously having any data then you have to clear it then we have to send the question silly case of which one said value at runtime all right then after entering the value sir we have to print the log thread test.logs same thing log status status then here you have to enter to verify to verify the verify user able to enter value inner okay in place name a new name what is the name first name example comma okay and here here um i can say name name place entered successfully successfully okay so what is in the try cache failure only here we have to change it come here failure to give it to this is called clickable way this is called enter visible or enter and provide a time and uh then record with waiting for the element and to enter to enter value to enter first name enter all right come back here so the same one you can use every way or wherever you want to use in the registration page here key base test base sorry test base dot enter text enter text driver is same element locator is a first name right first name already we are created and what is the value sir value that is coming from in a method okay what is the name sun we haven't created any name here create a name here okay i'm getting the name here okay this is called first name first name enm okay uh last name enm okay so there is standard okay email enm and this is called password in a pass you know and this is called confirm pass a name confirm pass enough okay you have to give the proper names here here first name name of the element okay name of the element don't get confused it's the name of the element only so whatever is there in the website right click on this guy and whatever the label here right this is one okay this one you can give it proper name like this you can give it and this is the one and here gender mail and email sorry okay and password and this is called confirm password perfect now come back to this old this one and here first name right first name a name first name name name of the element now copy the name all the things and come back to this one last name paste here here last name last name txt and here this value that we are entering runtime and the name of the element now i have the element i am going bit fast if you want to get any confusion just let me know uh probably this also and i have to change it or this one is email email text me text and this one is email here value here and here is the email name name of the element okay and here also copy this guy sorry copy this one and here um yeah password right password password txt element property name password value and here password name copy this guy come here replace this guy and here is the confirm password confirm password text and confirm password value runtime will enter and here also confirm password name of the element perfect now we end up with this last one test based dot test base dot dot click right we have to click on the register button now come here second element is a register button register button and the name of the button is a register button name register button name is not there perfect can come here communicate yes it's not yet and here is a button register btn a name here register register button all right to come down here and then perfect we're done with this stuff now come back to your test scripts right you come back to test clips and you have to remove this all the logs it's not required all the locks remove the sky see if you are keeping all these blocks it is clumsy you know reading the code also is difficult okay it in the code also is difficult and also you can if you want to remove this stuff also you can remove the stuff it's not required it's okay now the code is excellent all right so this also should be remote see your code is simple one right now right there's any questions here now shall i go and run this guy or nice i should i should wind up in next 10 minutes like that probably have any questions you can ask i wanted to cover this ability also but it's not possible actually we didn't cover the listeners that is very very important you should enter the random email address right we'll see that early it was second uh it was taken 967 now in this time i should take something else uh eight eight weight what okay fine let's just get him come back here perfect now reporter generator did you see this level 54 now time is 1154 come back to 354 open with web browser you see these guys this is the beauty of the report mine see earlier this is a report and now this is a report you see this see this is the actual one this is the expected one if expected one is failed right so that step is fail and you will show the red color and you will get the screenshot of the particular element okay so here uh we are doing some mistake here um okay fine to verify the user able to click on register link okay the install link is clicked successfully and to verify the user able to enter the gender may uh it's not click on here click on gender mail gender will click successfully verify user able to enter the first name okay first name enter successfully but what is the first name first name is not coming right okay so this value is not coming here so for that you have to go back here first name how we're entering the first name here the first name first name the first name you should print the first name i'm sorry i made a mistake guys i made a mistake this is a value actually this is the value it's not a first name it's a value just a value only now let me go and run it once because we should see the data which that is entering that application guys any questions so far please ask me that i'm expecting to house yeah i think yeah but unfortunately we didn't face many issues okay we should face issues okay we need to troubleshoot the issues first okay then only we learn a lot of stuff you know while implementing the framework all right it's entering something else here perfect okay this already it is word why it is not existing or fine that's fine no issues that's foreign copy this guy open the browser you see these values and information is unsuccessfully critical testimony interested successfully password is under successfully you see this registration button click successfully okay if you want to give the space here you can give it no issues but this is a way to implement the new kind of report guys okay and also we have to optimize the code right we optimize the code a lot we optimize the code at the class level and test scripts level we optimize the code at the page level also at the page level also i got it right any questions right guys um we can we can wind up because you know it's almost 12 i didn't have in my dinner also probably you also any questions guys anyone we can ask any questions no it's not at all this one so we need to implement a lot in this framework like you know business we have to implement it and a few more reasonable methods and weight weight weight are very very important weights um in selenium uh listeners weights and reasonable methods and one more thing called uh this one cucumber these four concepts are pending basically probably i will cover i'll try to cover in the next session if you have any no live another another live in the next week guys you can ask me questions no you should say it's not you so what's the plan for the next session i'll try to find out the um good time for this i mean continue with the next session um probably you have you had an idea right so you have an idea how to create enough framework you know how to start with that just one idea how we are doing that we would like to replicate whatever you taught today we would like to replicate it if we have any questions we will come back to you yes if you can practice the same stuff okay um and set up the same kind of framework information right probably it's gonna be helpful for the next session okay yeah and uh yeah so that's a good that will give you the boost for your next session there rama is there rajesh and been to bankers in wash sweeney was joined shin was joined i think he's sleeping will you upload the recording in google dress and like googling something i will i will upload i will upload and i'll show you across your team yeah thank you yeah i want to do it in the live i'm going to be youtube only so that everybody can access right so yeah yeah there's a problem with that account so probably we'll have an accession in the in the live on the youtube live only okay okay so i want to do you know um these live sessions you know going forward you'll have you know a bunch of live sessions and different kind of tools yeah okay especially and i want to focus on the framework level okay uh next time once you finish this selenium concept right selim java framework stuff right okay with fully loaded all the stuff okay then i probably want to start with epa testing okay okay so just just uh yeah just to just uh perfect i mean just to have your hands and experience and selenium concepts so that you will have no i mean no doubts anymore no things so you know are you have any questions like she's not there probably he left did i just show any questions guys no no i don't have any questions cool cool probably you already worked with the selenium automation testing right so you already cope with the multiple con what we learned in this session uh tiago you have any questions guys um sorry today you had implemented a lot of new stuff uh yeah so yeah yeah yeah this guy is no uh he is my best friend from uk guy he is also dealing with the multiple tools and he also wants to become a trainer with me yeah personally joined today that's the school buddy okay so tiago you don't have anything because you know uh one of the reason that i set up this uh live session for tiger and balaji and a few more folks because they are preparing for the interviews uh this should definitely help for them to explain the framework how they're going to implement in the real time to the interviewer okay yeah yeah absolutely yeah very thankful yeah that's great you're welcome um okay so shall we shall we wind up this one today because it's too late for you also for me also i will share one thing yeah let's go ahead yeah last time please share this uh videos and right now yeah once once end up with this meeting right so it's going to create a mp4 format video uh into my drive so it will take i think for 15 to 20 minutes because it's a three hour session right so probably i will be sharing the link in the skype or you know what's up okay you can access that and guys you know you uh follow my website every day uh you will get you know new stuff you know what are the things have been um going on in this things okay if you follow my website guys you will have you know updates every day so that is what we have done today so if you have any sessions in for the red so you can go to this website and you can see that what translations are going on okay and what things are going on and i have another website also that is still under progress probably i can show you that later that is not right now i can show you yeah so this is actual one i wanted to show you guys can you share these two websites in the same text sure sure i'll send out this link as well of the links and also this website names uh i'm i'm going to i mean i'm designing another website okay so i'm going for this website maybe does not exist i want to create a different website okay for betterment okay so any questions before we end up with this well cheers thanks
Info
Channel: rk Automationlab
Views: 1,216
Rating: 5 out of 5
Keywords:
Id: _QGxqZEWkCI
Channel Id: undefined
Length: 185min 30sec (11130 seconds)
Published: Mon May 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.