How to Use Selenium IDE for Automating Complex Test Cases | Pradeep Nailwal

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome all today i'm going to tell you about the selenium id uh how selenium id can help you in your selenium automation so first question is that what is selenium id so let me show you selenium id is basically a add-on it is a plug-in of the chrome automation so let me do one thing i will open a chrome or let me open up new tab here then i will go to the search part and will write selenium id for group now after clicking on it you will get this link selenium id click on it now you will see it will give you options layer id and add to chrome so click on add to chrome now you have to click on this add extension when it will click on add extension you will see it will open a pop-up selenium id has been added to your chrome okay use this extension by click on clicking on this i let me close it and you will see whenever you want to use your selenium id extension click on this extension button click on extension link and you will see this extension ids here okay now i will show you that how you can use this id to generate some code for your selenium automation okay so let me give a scenario let me close it let me close it now i will show you suppose take the example uh this is the application www.leafguard.com and you want to automate it okay so uh how you are going to automate let me give the example suppose take the example i have generated a java file there and i have written a common code like public static void main inmate i have written this code to open a browser then i have written go to enter the url so i've written this code okay so same thing you can say this code will do open your browser and then you have entered the url for your application now anything you want to any test case any scenario you want to perform in your application using automation so what you have to do you have to perform it manually and with the help of selenium id it will record all the things in the form of code and you can directly use that code in your this java file i will show you how it is possible so this is the application so i will do one thing just copy this url and now go to this extension click on selenium id extension it will open at this pop-up for you now you will see options here click on record a new test in a new project click on that now just give any name you can give any name and this name is basically giving a name of the project for your selenium id so i will say predi selenium sample project now click on ok when you click on ok it will ask that what what url you want to use for your automation recording so i will paste it here same www leafguard.com so whatever application you want to automate you just give the url of that application here and then click on start recording when you will click on recording it you will see it will open up this one selenium id is recording here you can see at the left side here and whatever action you will you are going to perform on your this browser that will be recorded let me show you how this is possible click on for example i'm automating click you have to click on edit button click now you have to enter in your email address i'm writing enter where the nail valve 55 at the rate gmail dot every 10 percent okay now you can write some text in textview so you can say i have entered something in the email address vietnam entering something here i am writing the data i'm writing recording test okay so i've entered this thing now you can if you want to perform some other things in your automation like get default text center whatever you want to perform means whatever you want want to perform here you can performs every operation using manual just you are doing it manually on your this one now after that what you have to do simply click on the selenium id and here you will see this option stop recording click on this when you click on this it is asking that okay whatever you have recorded i'm going to save with the name of any test so i'm giving a name pradhi first test kicks i've written this now click on okay when you click on ok you will see in this lineup id this test case is recorded here in the same way in the same way you can record other test case also but here i'm just giving the example that how you can use this recorded test case in your selenium automation so i will do one thing just click on this test case and you will see you will get option here let me let it make it big click on this one and you will see three options three dots here click on this and just click on export when you click on export it will show you the option to generate the code for this recording in n unit x unit java j unit javascript mocha python ruby whatever in whatever language you are interested to generate the code you can generate i'm generating the code for java here so select java is already selected then click on export when you click on export you will see it is giving you to save the file and automatically saving the file in the form of the java i'm giving the location desktop now just click on save now go to the location you can go from here also that where file is generated you can see this is the file here you can see the file of your first test case java now open it you can open it using notepad. i've opened it now you can see it has generated the code you can see so the thing is that you don't need to copy all the codes because it's generating the code using so many libraries in the selenium id you can see here generated by id but we know that whatever we have recorded we have recorded this scenario what recorded the data driver.get enter the url then it size you can see i have not make anything but because i was trying to make some size of the window it has written this code then it has written this code css selector to click on the that the first link that edit uh what is that name let me show here we have clicked on this edit button right so you can see this code is generated here this one so they are using css selector then they have clicked on email then they have written send keys and then in the same you can they have generated the code to enter something in the process you want to see this just do one thing i will copy this code from here you can copy the whole code uh let me copy this whole code i will copy this code still here and copy and we'll go to my this one and i can paste it here here you can see i can basically now you can see i pasted here so it is giving dimension because we have not copied the copy the import one you can see it is already included the import one for the dimension the data you can see here you want to copy this thing you can copy this thing and the code will run fun so let me do one thing let me copy this thing from here and go and paste it in the import section i'm going to import it here now you can see it is giving the import for buy dot id something so i have shown you already the shortcut keyboard control symbol now you can see all code is all the files are imported here by dimension web right if i will run it just see it is working or not so let me right click let me run as java application you can see it is working it is working you have not written any code but your automation is running so how you have utilized it you can utilize the selenium id for your record and play but i will suggest you that you can use for your critical things like if you are not able to find any xpath properly you can use this tool selenium id for your purpose and what is the other benefit what are the another benefit this whatever code you have generated you can run this code in any browser here you are running in chrome you can run in firefox you can run in a year internet explorer you can run anywhere so this is the this is the use serial id is all or also used for multiple purpose but i think you should use it for only this purpose and this is the best use of it okay and i have shown you that you can add this plugin this id slain might plug in you can add in your chrome browser and you can add it in your firefox also so you can you can use firefox for the adding the extension you can use the chrome also or using anything you can record it in the same way and it will make your life easy so i hope you got it that how you can generate your complex scenario with the help of selenium if you have if you have liked the content if you have like the video you can subscribe to my channel also thank you
Info
Channel: Lets Make Automation Easy - Pradeep Nailwal
Views: 3,096
Rating: undefined out of 5
Keywords:
Id: yGoRKwhXbTY
Channel Id: undefined
Length: 10min 15sec (615 seconds)
Published: Sat Jul 30 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.