How to debug Selenium Framework Code using Eclipse Debugger

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys this is the B here welcome back to another non official ops guys today I'm going to cover one very important topic I would say a technique that is called debugging techniques how to debug your code so debugging is very very important is when you join a new project or new company and when you see that okay there is an existing project is already there and you have to debug the code and you have to understand the code step by step and ok and you have to get the confidence also because people who will give you a lot of confidence you should know how to do your skills ok I mean debug your code so that's a very important skill that you should have as an automation engineer so how to debug the code and how to you know write some you know some debugging skills and how to cover those skills at a time of existing framework so whenever you have to join a new project first what we have to do that they will give you the project and the former repository in the form of git repository or maybe bitbucket repository or maybe SPM depository so you have to check out the core you have to clone the code in your project in your I mean in your machine and then you have to start with and then the actual thing will start do not a run your program or to run your automation framework okay from the beginning itself that without knowing anything if you really want to contribute towards that framework you have to know what are the different components Oracle if it vary exactly the test files up in different variants of the page liability configuration liabilities utilities environment variables how exactly they are generating the report and everything you have to know about it then only you will get to know about the framework and all these things you will get to know when you debug the code so debugging is very very important base ok so if you remember that we have already created one page object model series completely and the entire code base is available in my current repository so today we will check out or clone that particular project from the grid repository in my local laptop on my machine and then we will import that thing into our Eclipse and then we will try to debug the code right so let's do it so this is a I'd say I'll open my get repository so this is my great repositories at Naveen animation in 20 and what I'm going to do that this is the page object model so this is the URL will be given to you okay when you join the company because nobody will give you in pendrive or Hyde desk or something like that right because a huge repository and there's so many changes are there so they have to deploy somewhere on maybe get repository or bitbucket so they will provide the URL and you will see that okay yes this is the page object model and number of files are Philippines over here and this is the pawn bit XML file so immediately I will get to know that okay this is some even project so first I have to clone this project so how to clone so I will go to my terminal and I will go to that particular repository where exactly I want to clone so I will go to my let's see I'll go to documents and this particular document I'll do one thing I'll create this folder my palm framework and I'll open this framework let's see this framework is already available let's move to first and let's see my open framework is available over here and this is a folder that you create a one random folder you can create right inside this what I'm going to do I have to clone this particular project that is available inside man here it is in this particular get repository so I'll do one thing I'll just copy this URL and I'll go to terminal and simple and right get and go to that potato territory so my directory is available over here I am document in this particular my palm framework that folder that I already created and simple and use now git clone and I'm going to chlorate it saying that no such file directory okay just a minute okay so I have deleted that particular folder I'm going to create one more folder once again use earlier is doing some experiment so maybe it's not creating so I will go to my documents you can go to any or see what right create a new folder let's see my folder name is my form framework right and I'll go to this particular my own framework it's a blank folder and I'll go to my terminal I will go to that particular directory so that's available inside My Documents folder so I'll go to city documents or I'll do one thing and cooking back yeah so I'm currently I'm available in CID documents you can see that this is the documents directory in this particular directory I'll go to that my palm framework inside this it's okay I'll do one thing let's see page object model is already available over here so I'll delete this page object model okay and what I'm going to do now I'm using git clone and just roll it so you have to enter the URL and git clone once it is hundred percent done you will see that page object model open that directory and SRC main Java test our comrade XML file everything is available in by Machine now so what I'm going to do now is that I have to use this particular project in my clips so I will go to file I know that palm got excellent mean that's a existing maven project so I'll go to new import and open this maven and click on existing maven project because I know this is existing maven project click on next and open that directory so I will go to my documents my form framework open this page of tech Malta rectory and then click on open so we will see just a minute I think some existing project is already there so let me delete this project okay let's import it again import existing maven project browse and go to documents my palm framework page object model click on open okay and think just a minute let me check okay so let's import it again go to file click on import execs similar kind of thing you have to do lies because this is a maven project maven select existing maven project click on next and select the directory once again there we have to we have already cloned ok all the directories are available over here and click on open now you can see that ok page object model I'm going to import and click on finish so you will see that free CRM test page object model is getting credit over here right so this is the project everything is done I can see that BOM got XML file is available here now first thing guys what we have to do the immediately what we have to do the first file is format XML file immediately and open this and check what are the different dependencies are available inside the bomb got XML file so that I will get to know what are different utilities I mean what are different libraries they are using external libraries so I can see that ok they are using selenium Java by three point five point three or they're using test gingy and a patch fi API to read Excel files and they are using extend report right to generate the report and everything and maybe they are using log4j PA or some other ApS as well right and yeah so this is the thing that the complete folder structure you can open let's see the complete folder structure you can see that ok pages are available and we have SRC test now is available under that we have number of contacts based or Java homepage test or Java these are different test cases are available and complete SRC main Java and SRC testify is also available now what I'm going to do that ah first thing guys first check the first step check that open any test case let's see I'll open this homepage restaurant Java and immediately home paste or test or Java I'll see that ok yes this is my test class having number of test methods have been able over here I'll try to execute one method and check that it's working fine or not so right click on it and simple run as test change in test let's assume it's working or maybe some time it doesn't work because in your laptop and your machine you have to want bigger couple of things I can see that ok browser is getting launched and the test case is running fine right so I can see that it's running fine but I want to see the flow of the application ok so I have to debug my code one by step by step right so how do we bug the codebase so debugging is very very important but before debugging LJ couple of things over here that ok yes I know that this is the page object model so first I'll check what are the different pages are available in which package it is available so I'll go to CRM to my pages and I can see there ok yes these are the different pages so here I found number of pages are available over here so it will give you the confidence yes that in my training and according to my understanding of it object model that yes I learned that page object model beans for each and every page you should have a separate Java class so I can see that for each and every page contact pins not javadi's dot Java home based on Java login signup class based on Java pages are available and open this let's see contact based on Java and I can see the structure of the contacts page dot Java that I guess different ed great find by page factories are defined over here and then they have written all the you know respective methods of context painter on Java is OK tip is over here same thing for let's see de Pays or homepage s dot java it's written like this right so now I got to know that ok yes this is the home page is not Java after that I have to check where are my configuration variables the environment variables because I want to see but this is the most important thing that wait exactly the URL is available on which environment they are going to execute uh from them so let's see the URL all those things are available in quantum properties produced tomorrow you have to run it on your QA environment or maybe stage environment so your application you are will be like this www.qcnet.com on the wit www.state.gov right so you have to change the URL your managers say that ok team leader will say that ok execute and our QA environment so you change the URL you have to go to the configuration properties see compute or properties available over here and I get to know that ok yes here is a URL is available and the username password and on which browser you want to execute so I can change the browser also so I captured all these information and step by step I will get the confidence that ok yes this is the flow of the application of the framework now what I'm going to do that I am going to execute any program from test because you have to execute the first layer the first layer is always your test class right the first layer is always your test class execution that you have to execute your test because this is a beginning of the flow so what I'm going to do that I can see that ok then you should know how exactly tests ng works so I know that intestine GB create this home page test or Java and one base class available so I can go to first base class I'll check this is the you know the parent of all the classes and I can see that okay here you are initializing all the properties and everything and this is the initialization method here you are declaring the browser name and on the basis of browser you are initializing your driver and I can see that okay driver is initialized at the class level so that it can be accessed by anyone right and here on the basis of the browser name I'm initializing my chrome driver and everything so very high level I got to know that you are getting the URL from the properties and everything but through debugging I want to check each and every step Oh exactly it is working so that you will get the confidence so what I'm going to do that I know that in destined G first entered before method will be executed and then immediately I will see that okay a line number 30 one initialization method is getting called so I will put a debugging debugger over here so how to put a debug or breakpoint so this is called breakwire I simple double click on line number 31 so you will see that at line number 31 once Oracle is created when dot is created that's for debugging point okay that is point debugging point now what I'm going to do this particular debugging point the moment I execute this program what exactly it will do it will stop and line number 31 and then I will go inside initialization method so how to go how to jump to a neutralization method from home paste tends to are Java simple press ctrl or for Magnum Mac users we are simple press command or for Windows just press ctrl and the smalls over and then click on it so it will will jump to initialization method and I know that okay inside initialization method we have browser name is written over here okay some debugging points we can put over here as well so on the basis of this particular variable you are checking if it is Chrome then launch Chrome driver but I want to check at the runtime what exactly the value is coming inside the debugging board right so I'll line number 41 I'll put one one more debugging point over here so one more debugging point like this right and then on line number 53 as well I'll put a debugger and at line number 64 also I'll put a debugger so what do you mean by debugger point this breakpoint this is also called break point or debugging point this break point is called a debugging point is called that if you have given one debugging point at line number 41 your execution will stop over here not a stop exit your execution will be paused okay your execution will be parked over here that okay on line number 41 it will stop over here and then you can check whatever you want to do you want to check some variable value what is going on or what is the statement value what is expression value is going on you can check I'll show you how to do that right so a couple of debugging points I have you know I have put and at the runtime also rise you can put number of debugging points and you can remove the debuggers as well right so let's do one thing you have to first you have to get into the debugging mode debugging perspective so we have this plus icon is fine can you see that this plus open perspective just click on it and here you have debug perspective this click on OK so you will see that you will now entered you will enter into the debugging perspective in debugging perspective it is different from normal perspective that is for Java perspective if you want to come back to your Java perspective click on Java again normal structure will be displayed click on debugging perspective it will be displayed like this and then some expressions are already written I will remove all these expressions here let me remove okay and some you can check the variables also you can check the expressions as well debugging stacktrace also you can check this is a console screen ok let me clear this this is the console screen the output is screen and this is a code and this is the outline that okay inside the whole base test what are different methods very even certified over here right so what I'm going to do now I have to run this program and debugging mode so how to do that so I'll do one thing okay simple right click on your because this is the home page text or Java right click on it and instead of run as simple debug is as distant you test so you will see that immediately it's getting stopped at line number 31 and I know that okay line number 21 is initialization although this line number 31 the controller is available on that particular line but I haven't executed line number 31 so how to execute this particular line 31 so how to execute that to execute this thing what we have to do is we have to press f6 so there are three debugging for debugging options are available we have this option is called f8 that is called you may resume sorry not assuming resume we have a fight that is quite step into we have at six step over and then we have step to return f7 so what we have to do if you want to execute this line number 31 you have to press this f6 so you can execute this you can press this particular button or icon or you can from your keyboard as well you can press f6 so let's yell going to click on this f6 so stair six means step over simple okay execute this and step over so immediately it will come inside the initialization method and on line number 41 you can see browser name equal to prop dot get property method this method is written over here now ice know that okay this prop got get property is coming from this particular browser property which is available inside the property plus one thing got properties right so now still nine number 41 if you mouse over on browser name variable it's not showing anything not doing any value why because we haven't executed line number 41 the controller is still available on line number 41 again I have to execute this line 41 simple again press f6 you will see that now if you mouse over browser name you can see the run time chrome is available right and if you want to check the statement as well simple copies is a statement eyes and right click on it and go to watch you can see that prop dot get property the value is coming chrome chrome is double so you can check the statement value statement or expression value also you can check in debugging mode so I got to know that okay yes this property is giving cruel right and at the runtime let's see my conflict or property is having URL as well so I want to check what is the property with URL s-pen so I can write the expression over here raised Rob dot get property URL although in my code I haven't written but at the right time you can check that fertility is with my property name is URL and just press ENTER see the URL is ccrm god I want to check what is my username simple and check username and press enter so username is not even gay I want to check what is the password password is test and rate one two three so browser URL username password all these properties are available inside this one filter property that I'm using all these properties inside the debugging mode right now the debugging 41 line what execute I got to know that okay yes chrome is available and chrome dot equals Chrome then continue come inside the if spot and then continue fine now I am going to terminate now let us assume that inside my conflict or property you forgot to enter any browser name let's see that's a blank and now I'm going to execute my poll once again in debugging mode you are going to debug the code fine so again it will come inside the initialization press f6 it will come inside the initialization method and press f6 you will see that browser name is equal to blank now no value here also you can check browser name is blank no value so you will immediately you will get to know that okay yes browser name is blank so blank dot equals chrome low it will come not it will not come inside the if part it will come in it will check else it what again it will not come inside the else's part so now the driver is got null because you haven't initialize you have AB driver you declare your web driver at the class level over here but you never initialize this right because it will be the condition okay but never satisfied so browser name is blank dot equals Chrome it will never come inside the if condition or else if condition so your driver could not be missed right because of this problem because you have a return browser is equal to blank over there so immediately you will get to know that okay yes this particle property is coming from unfilled or properties file and immediately you will get to know that ok yes that is why I am getting from null pointer exception because you have to debug your code right now at the moment you execute this line it will give nullpointerexception see again it will coming over here that inside the catch block invoker Tour class and if you continue a program just press f8 immediately you will get to know that setup method nullpointerexception is coming where exactly it's coming now you have to check the stack trace as well you will start from the bottom homepage tends toward java line number 31 did here it is working fine then 10 space not Java 9 number 53 and this particular line you are getting what you are getting Val pointer exception so you will get to know that ok yes on line number 53 I am getting null pointer exception because my driver is null why a driver is none because you could not initialize your driver so I have to debug my code so I am going to debug this particular code Divac against s ng test and f6 and immediately I will get to know that ok while debugging my code that oh my god browser name is blank so that's a problem so immediately I'll go to my configured properties and I'll make those are equal to Chrome or whatever so I'll dominate my program once again and then I'll write home waiver right so that's my nice two things you are resolving your problems ok in debugging more because you are checking the internal depth of the framework internal depth of the code second thing is it is giving you the confidence as well right the debugging will give you the confidence because you are getting to know what exactly these guys they have written how exactly the code and the work flow and the flow of the framework is working right so that's why debugging is very very important base ok ok so this is the thing now let's run inside a debugging mode once again debug as test ng right so it will stop over here at initialization and then fine but all the name is equal to what is the browser name browser name equal to chrome chrome dot equals chrome and mission is satisfied it will come inside up if condition it will check the property sell the property and then everything is fine driver equal to new chrome drivers right now if you see the driver is still man why because I haven't executed 9 number 45 I have to execute line number 45 then only driver will be initialized right case so I have to execute this line once again press f6 and Driver equal to new chrome driver and the browser is getting launched right and you will see that if you mouse over driver God initialize driver is initialized with with this particular value okay so driver got initialize fine and driver is not null now so it will not give the null pointer exception and we have resolved that problem now so again press f6 it will continue it will come over here okay it will initialize all your event listeners and everything and then it will maximize the window delete all the cookies and now see that timeout also so no need to go to page load time out so you can look at the run time you can check just mouse over what is the value of timeout the timeout value is 20 what is the value of implicitly weight in physically weight is 20 right so executed and then you want to check what is the current URL is going on so you can check this prop going to get property URL just copy this or maybe right-click on it and simple click on watch you will see that property get property URL instance double double dot 3 CRM dot-com is going on so driver tour to get it will take this particular URL and then it will launch the URL now so it's launching the URL ok see it is launching the URL so till here initialization method is done again press f6 now it will come on line number 32 the line number 31 initialization everything that drama is done the magic is happening that yes it's launching the browser entering the URL and blah blah blah now again back to line number 32 if you come to line number 32 if we will see that okay yes see test util is none why because I haven't executed line number 32 I have to execute it I have to initialize my test you tillich will do new test util with the object so now test util is coming with some object value this is the audrey has four where you we are not bothered about what exactly this number is come things but I got to know that this is not none my object got initialized my reference got initialized again for login page and home page for contact page fine login page fine so you have to check every line that are you getting any null null or not you should not get any well otherwise in future it will give you null pointer exception now I want to check that ok yes on line number 35 at the run time I want to check what exactly the property dot get property username value so again you can right click on it and simple select it's select the statement and then right-click select this particular statement and simple right click and go to watch so you will see that user name is Levine game same thing for password again select this statement go to watch as 0.23 right and you mouse over on prop prop is also initialized it's not giving any null what is prop drop is the object reference on properties file so that is also fine it means in here now I'll go to login method I'll put a debug or over here on line number 46 I want to check what is the username and password is coming over here again press f6 so it will come over here let's stop over here and then what is the username c 'mouseover user name is Naveen game password password is tester at 323 if you want to check in the form of very banal so you can check user name is Naveen give password is test at the rate one two three and then I'll pass the send is step by step you can see over here see it's entering the V&K and the password is its fedsim eyes it like this Lavine gay and see the password password for entered and then at Twitter icon login button see it's clicking on login button and coming inside the okay coming on the home page so that is also fine and it's returning home page object so in press f6 so 10 here this execution is done fine so setup method is done that initialize the browser entering the URL username password and coming on the home page that is set up target is finally working now it will come inside this particular variety equal to one it will come inside over here so and put a debugger on nine number 41 right and then I can check that of the home page verify home page title I will go to this particular method and I'll put a debugger over here is well and then press f6 okay so let's press f8 actually it will move to that directly to the next debug you so it is coming over here and then again press f6 so you will see that okay yes driver is not null so I will get the title whatever title is available so I can check the expression so simple select this expression and watch so you will see that driver or get title is what CRM PR and actual is CRM PR o and then driver or get title will give you a string that is for CRM Pierrot will be given back right - so see I'm calling home page dot verify home page title the verify home base title method is giving you see our entry level string value remember functions in Java covered or we do not be QROPS it or test whenever I call a function or a method it will return something so it is returning CRM PR OC r MP r will be given to this guy and crm PR o will be given to which title spring and I can check at the runtime currently it's not giving any value why because this line okay could not be executed only left-hand side only right hand side we have executed left-hand side is still pending so if you run properly so now the line fully got executed full line got executed and now if you check if you check home page title is CRM here you can check inside the variable also phone face title is what CRM here find now you are going to check a so dot assert equals home page title is CRM Pierrot which is equal to CR MP are absolutely working fine right so now let's see guys I want to press one option is also there is step into so if you press f5 step into it will come inside the assert class also see check a certified equals it will come inside the a third class as well it will come inside also it last one method is there a third equals we are passing the actual value is this and the expected value is this right so we will get inside the assorted class as well so the step into is doing what the step you do is getting into the method as well so generally we don't use a step into right if you put a debugger over here right nine number 189 although it's a test in G library which is already available and already created by someone in test in G so we don't need to debug that because we know that okay yes this code is absolutely working fine which is provided by testing G so I don't want that also equals is working fine lot because I am NOT going to test tests in G right so I can close this I don't want to use that and simple I press f6 see if you press f6 again it will check one by one over here so better to press f8 now so that it will jump the first test case is done it's getting a title and your first test case is absolutely running fine you can check that okay yes verify homepage title is working fine now it will execute test case number two but before test case number two again it will do this particular drama so again on line number 47 and put a debugger and then press f8 so it will stop to the next debugging point so it's stopping over here browser name equal to again line number 41 it will stop over here so I know that okay this code I have already tested who may be working modes so I I don't want to run line by line so I'll just press f8 once again see it's executing again I press f8 and I'll get the title and check the expression expression what is get property you are and get property URL s3 cnn.com so I know that it's working fine so f8 so it's entering the URL and again login also is happening properly because I have already tested in my first test case now and finally it's coming over here and at line number 47 it will be stopped and I know that okay switch to frame now I have to switch on that particular frame so switch to dot frame is available in test util so what exactly we have written switch to frame is that okay fine so we will debug over here and we will put f6 and we will see driver is in each Lyceus make sure drivers should not be in the race if your driver is null somewhere then it will give you that pointer because null dot switch to will not work we cannot perform anything on non reference right so frame main panel it will switch on that particular panel and is fine fine and then again assert or torso D equals it will check verify correct username so again verify correct username you can put a debugger over here line number 41 again press f6 it will come over here where if I cannot use it now user name label I have to check that user name label is correct or not it is displayed or not so I can do one thing this user name label I can put in expression simple right click on it and go to watch so you will see that user name displayed is same pending because we haven't executed this line number 41 right we haven't executed that so I just simple see okay now I will press f6 once again okay see F sake is not getting enabled why because still not showing some time it takes some time to display all these menus okay so let us wait for some time and then it will be displayed see now you can see that s of the options are available over here and f6 again is available and you will see that user name label dot is displayed is not giving anything why because I haven't executed this line right so I have to press f6 so you will see that it is checking on the page the user name this naveen k is available or not and still it's doing something in the background still all these elements are not these menu items are not available debugging options are not available so let's wait for some time and then see it's again it's checking over here and then it's saying some error maybe some error is there and then if we come inside the catch block it means there is a problem okay it will come inside the invoker dot class which is not written by us it is written by test in G and it's coming inside the catch block it means some exception exception has been thrown and simple I'll run in f8 code a complete mode and you will get to know that okay yes the second test case got failed because of no such element except okay the beam K is not available or maybe some XPath got disturbed or whatever okay so that's fine let it be failed that's fine now again the third test case will should be executed again at thread the four method will be executed setup method and continue so you can debug like that place step by step base you can debug let me terminate this right so this is how we debug the code right debugging is very very important at the runtime you can check the expressions you can check the statements values you can check the variable values what exactly the value is going on and these steps are very important f8 okay f5 f6 and f7 f seven wins the step C this is f8 resume this is step into this is f6 step over and this is the step return it means come back so generally step return we don't use we use the step f5 step into and step over now what is the basic difference I will show you quick one diagram people might ask for a time of aw so let's see I have this particular class right in this particular class I have written some code number of lines of code I have written okay some lines of code I and let's see this is 9mm one two three and I have put debugger point over here and here here here and on this particular aspect so number of lines I want to check that okay yes I want to see debuggers on this road over there where you feel that okay yes this is the important line I want to check what is happening over here right so I'll put a debugger point on the okay on the basis of my understanding of the code now what I'm going to do that okay execution will happen so this is running fine this is also running fine the line number two and then it will stop over here right so controller will come over here immediately the controller will stop over here now the controller now if the user the programmer like me I press what if I press f6 now what will happen if I press f6 over here so the controller will jump from here to on this particular line okay but if you press f8 if it means resume F it on this particular line so the controller will jump from here to here okay here I mean jump not jump exactly it will stop over here it will execute let's see in between we have number of thousands of lines are written over here so it will execute all these lines and then it will stall over here but if you press f6 it will come from here to here okay line number four - five - six - seven - eight nine ten and then 11 like that step-by-step f6 means step by step but f8 means it will just it will okay it will execute from one debugging point to the another debugging point in between it will not stop it will I see you'd all the lines and then it will stop here exactly the next debugging point is available right so this is the basic difference between f6 + f8 + f6 means step over ok execute this particular step and then move to the next step the third step and the fifth step now now let's see now f5 what is f5 f5 means step into now let's see on this particular line this particular line what I'm saying this particular line the code is written like this or sir dot assert equals is written let see some code is written like this on line number this now if you press on this particular line the control is available over here if you press f5 f5 means step and do if you press f5 over here what exactly will do it will come inside this assert equals method now also equals method is written somewhere in the third class in test and you were here this is a board for Assad equals so it will come over here okay this is a board for us what equals it will come over here ways on this potato right but I am not bothered about it what exactly it's written over here so that's why I don't want to use a step into so button just press f6 thumb switch from jump from here to here don't if you write step into it will come inside that method is will so this is a system defined method also equal is coming from the system from a stranger's word class so I do not want to get into this particular so it okay ah sorry equals method because I know that this method is written by some professionals some experts right so I don't want to check into that but let's see on this particular line now the controller will let see assume available over here and then statement is written like this I have written one method over here let's see Cody J dot get main method and I'm passing some name let's see like extremely and some red cold I have written like this okay so named method is returned and then it will come inside the getname method if you press the step into it will come inside a step name and it will check all the things over here that how exactly and what exactly get name is working so if you want to do that thing also you can press f5 because this is custom method this is user-defined method that I have created getname method I want to check inside this method as well what is happening as you can put a debugger over here as well right you can put a debugger over here as well one and two debugger so you can write it over here and then if you press f6 from here it will directly jump into this particular next debugging point right so this is the basic difference between f5 f6 f8 and one okay so guys these are the debugging skills very very important it will give you the confidence if you join any new project if you see a new framework either it is complex or simple you have to debug if you debug if you are deep if you are really good in debugging things you can crack any any automation framework complex automation frameworks as well okay continious need two or three days if you are looking into the code and checking the food in the debugging style you can learn the framework new framework 50 60 percent things you can easily learn in next 2-3 days and rest of those 50 60 sinks for 40 30 40 % eventually you will know when you work with that code and you will design your own code and you will introduce a new frame I mean you test cases and everything in that framework but lot of confidence you will get by debugging the code so that's why I see whenever you you give any problem to me but nothing please this is not working please check what is happening I always debug that code right so whenever you stuck somewhere debugging is very very important whenever you want to learn about the framework flow debugging is important whenever you want to stack trace that ok where exactly the problem what exactly the flow of the framework debugging will help you so debugging is very very important based right and again once your debugging is done then simple run your program properly and then check everything is working fine so there are two options right click run as without debugging how many debuggers coins we have written doesn't matter it will skip all the debugging points but if you run as debug okay so it will check each and every point okay it will stop at each and every debugging point now let's say you have went put any debugging points any debuggers points we have not put anything and if you run in debug ass it will not stop anywhere it will just like run as now because you haven't put any breakpoint over there or any debugging point over there right so step by step with your gut feeling put the you know put the debugging points on the important lines and then the program will stop over there and then you can check what is happening over there step by step and number of options come into picture then we have f5 f6 f8 right all these things comes into the picture then right again once your debugging work is done back to your Java perspective number the folder structure is over here and all the code everything over here right so you can take any any either it is cucumber either it is test ng page object model data-driven approach even tripping over it any damn framework either it is ap automation as well debugging is important base debugging is always always important debug the code get the confidence write down your notes that what is happening in this particular method what exactly this method is doing in everything you will get the complete slow each and every class you will get to know about it okay so thank you so much for watching this video that's all for this video guys and let me know if you have any issues and this is my paper repository you can check the repository enough in animation 20 page object model if you want to capture the entire code is available just clone it and just you start using it and you can this is a very good example for debugging you can debug the code and I mean automation laughs you know that ok this is my channel name and let me know if you really like this video ok please subscribe and share this video and with your friends and colleagues and if you have any questions write down your questions in the comment section definitely I will try to reply over there okay that's all for this session thank you so much thanks for watching guys
Info
Channel: Naveen AutomationLabs
Views: 40,523
Rating: undefined out of 5
Keywords: selenium, webdriver, how to debug a code, debug in java, How to debug Selenium Framework Code
Id: c4VRGEK2oHA
Channel Id: undefined
Length: 45min 51sec (2751 seconds)
Published: Sun May 27 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.