Hello everyone, in this video session, I am going to explain part one of selenium for that is, I am going to introduce you guys to all the new features that got introduced in Selenium for version. As part of this session, I am going to first cover how to install and configure Selenium four and execute a sample Selenium four screen to get started with once the session is done the next video session I will introduce you to all the new features one by one. So guys, in this video session, I am going to explain how to install and configure Selenium for and IE after installation and configuration how to execute a sample Selenium for script. So let's get started. So before I practically demonstrate, let's go through this theoretical part first, where we have to first understand that Selenium is not officially released it. Okay.
So what happened actually is in August 2008 in one of the conference that happened in Bangalore, that is Selenium conference that has happened in bandwidth, the founder or the main member of selenium that is Simon. See what has announced that Selenium four is going to be released by the restless Oh 01 yet, but this didn't happen, guys. Okay, it didn't let happen. Still it is not released. Now. Today's date is like November 1 2019.
And still the Selenium four version has not been released it okay. And it's being expected that it is going to be released soon though. Okay. It's going to be released soon, though, mostly in January. is expected to be released in January guys, but still not sure. But it's going To be released soon, if not in January, it's going to be released soon.
Anyhow. Okay, so But how can I install and configure Selenium for them? When Selenium four is not officially released? How can I install and configure Selenium four? There's a basic question question right? So what's the point of me explaining Selenium for new features and all those stuff when Selenium four is not released?
The answer here is even though okay even though the stable version of selenium for stable version of selenium four is not released, is not released, but but Selenium for alpha versions alpha versions are released Yes, okay. Where you can find them. You can find them in the MV and reposted assemblies okay. This is unofficial you can say okay, selenium for alpha version is not like a short one. So this alpha hears mentions Alpha here mentions that it is in testing k state okay? It's not a stable version which is officially released it is a stable version.
But now we just have the Selenium for alpha versions provided in this recall the MDN reposted.com okay this website Selenium guys have released the Selenium for alpha versions these are still in testing phases okay. They are not stable they are they will have some bugs or issues okay. You can find some issues in this software when you use Selenium for all four versions, okay, they are not stable because they are not seven, they may not work as expected is okay. So it's better that whatever that I am going to explain is for your experimentation purpose or trial purpose. Okay. Just to try again, right just to write this trip I am going to explain the Selenium for all four versions and all the new features that got introduced in Selenium four, but don't actually implement this Selenium for all four in your origin.
Okay in your original or real time projects it's not recommended guys okay. Don't use Selenium for alpha versions in your original or real time Selenium projects okay. As this is Selenium for alpha is still in testing state alpha means alpha release means test testing state after alpha we have to go for beta okay Selenium four will be released as beta afterwards and once after beta then a stable stable of shell version will be released we have to still wait for the stable official version to be released then only guys we can actually implement them in the original or real time projects but for now, whatever that I am going to explain this don't try in your real time project space okay don't write it's just for your learning purpose or like before actually the Selenium for is coming. We are trying to learn our experiment and see how the Selenium for actually looks like I know Okay, out of curiosity only, but don't actually use it here.
Original real time projects fine. So, we are just going to try Selenium for now using the alpha versions that are there in the MDN deposit.com Let me show you where exactly this alpha versions are provided that is in the MV and repository. Okay? So open any browser here and go for a Ambien repository.com Okay, just browse it and we unrequested.com in this search, just search for this selenium, Java race. Okay, simply search for selenium, Java, this kind of thing we'll come we'll come to Selenium Java. As you can see, the last version of selenium threes 3.14 1.59 after 3.14 1.59 you can see some alpha versions are available here okay.
Selenium for alpha one, selenium for alpha two, selenium for alpha three alpha means in testing status, they are not stable it okay. If you if you use these things, you can actually get some issues. Also in Selenium guys are still changing few things okay? Tomorrow Alpha Phi may come on for 10 hours on may come we don't know because we can't decide the future here. As you can see alpha one may not have something that alpha two has an alpha two doesn't have something that alpha three has right it they are they're keeping on improving this Selenium four version for now, but few features are there they already introduced this new features of selenium four okay which we can actually see when you when you actually use alpha three you may get all the up to up to date latest new features available in Selenium for tomorrow when Selenium phi comes it may add few more new features Okay, so let's not wait for other alpha versions but let's get started with understanding whatever the features features that are added to the Selenium four version so far, okay alpha version so far fine.
Now, so as I already mentioned, it is there in the MDN repository we can actually just get this okay latest version of selenium for all phase alpha. So I will definitely use alpha three because it's kind of latest when compared to the alpha one alpha two. Okay, so for demonstration in this current video session also I'll be using the alpha three because it's kind of latest when compared to alpha one alpha two, that's fine. Now, so as I already mentioned Selenium four is not officially released if it is actually released okay. If Selenium is really if Selenium is officially released, in that case, where you can find the software is where you can find the Selenium for if it is really have officially released. In that case, you will definitely file in the signature dot o RG okay.
If you go to this download page and you can see here Java and what is the version 3.14 1.59 is only the latest that is still Selenium three is actually Selenium three is only there is. So Selenium four is not officially released into the market and we have to wait until it is completely realistic. But just for experiment and trial or curious about the future. So what we can do is we can actually try out the Selenium for works, okay? And we can see if we can learn from the differences like alpha one, alpha two, alpha three, whatever the features that got introduced on a day by day basis, we can actually try try it out and find out how they're working okay. So, let me let me practically demonstrate installing and configuring of selenium four, okay, using the Selenium four alpha or one of the Selenium four alpha versions, I am going to practically demonstrate installing and configuring Selenium four.
So let me first download that. Okay. You can download configure and as you add a sample Selenium for script. So here is you don't have to download Selenium for actually because we have this Mavin Mavin. You can add this to the pom pom dot XML file, right? This will automatic POM dot XML file will automatically download this Selenium for us.
So in that case, what I'm going to do is I will first create a new I will say new and say other guys Okay, after that, you can see here you will see all these options I will expand this Mammon and select this Maven project is instead of creating a normal Java project in Eclipse ID, I am going to create a new Maven project click on new next and click on Next. So, and here you see you have to select this quick start in my video session anyhow, so just click on Next. Then use some names here guys artifact ID means the name of the project. Okay, I want to give it as a Selenium forensic okay. The project name I am giving a Selenium for alpha. Let's say you can give any name Yes.
Okay. I'm just giving for as I'm going to demonstrate Selenium for in this video session. I am giving the Selenium for alpha kind of text we can even give Selenium for also not a problem. Okay then Selenium for a while do some projects okay so that it will represent the project Selenium for project you can you can give any name here okay there is no restrictions or rules here you can do some something like let's say tag one okay here Heroes is a pack one package one simple back to pack one just do the same package name in the package and group ID and then click on Finish to see Selenium for project got created here and use a creating Mavin are at the end it's getting ready okay it's getting Maven project is getting ready. So let it complete guys okay let let it completely progress.
Once you create some Maven project, it will take some time okay to get ready once it is ready here when you don't see anything here. Just expand this project and expand this SRC test Java and expand this pack one. Okay, we have given the name of the project Selenium for the project and artifact ID that is nothing but this one is like package name and group ID, right? So now delete this default app test dot java from here. We don't need that. And route right click on this.
Okay, right click on this new and say class package and say new class and give the class name as something like demo one. Okay, demo one. And click on Finish. Create a main method inside this class, public static void Main. Spring off ox, Java code a simple Java code here. In between this Java code I am going to write the WebDriver.
Okay, driver. Selenium code I'm going to write driver is equal to new chrome driver or something. Okay, when I do this and I hover the mouse here, right? You cannot Import guys because in this project Selenium is not configured right so openness POM dot XML file now and remove this dependency we don't need this dependency j unit dependency for now and go to this young vn repository.com let me go with freshly mbn repository.com I am search for selenium, Java then click on the Selenium Java and as you can get all the alpha version size consider Selenium for alpha versions available here. I will choose the latest alpha version that is alpha three and then I will copy this Okay. I will copy this Maven dependency for and then paste this thing here.
Okay, this is a Maven dependency core offer. Selenium Java version of For and with alpha three now, save the project guys. Now you see it's getting downloaded and configured automatically. You don't have to do anything else. Okay? Yes provided the dependency types of selenium for alpha three in the pom dot XML file and save the project.
That's it. Okay. Your project will be now considered with Selenium for automatically, again, automatically downloaded and configured. Now after that, when you hover the mouse on this WebDriver you see you're getting this import WebDriver Okay. Now I'm actually we are actually using Selenium for Okay, so just keep that in mind. I'm going to now I'm going to execute a sample Selenium for script No.
Okay, sample Selenium for script now, or the modern chromedriver and import this chrome driver. And as you already know, before opening this, we have to actually provide an EFC file chromedriver dot txt file or the simple, very lightweight, we can use WebDriver manager, right. driver manager Got this will also not come for that again you need to search for web driver manager just search for it you will get this GitHub Bonnie Garcia WebDriver manager link just click on that link without having this configuration for WebDriver manager we can I cannot use WebDriver manager also when you scroll down a bit we will get to the Java dependency for this WebDriver manager like this copy this Java dependency for this web driver manager class I go to this palm dot XML file and along with the Selenium for dependency I also have this WebDriver manager dependency into the same palm dot XML file between the dependencies acts okay just between this dependence so so far we added two dependencies okay.
First dependencies Selenium for alpha three and second dependencies WebDriver manager now save this. Now WebDriver manager also will get downloaded automatically configured in this project. Now go to demo one guys And hold the more than WebDriver manager. Observe that import WebDriver manager will come. Since we have to open the Chrome browser here, we have in the WebDriver manager.we have the same chrome driver dot setup. And this is a code.
So you don't need now you don't need any chromedriver dot txt file to be provided. Okay, simply say WebDriver manager dot chromedriver dot setup. This is done. Now directly say WebDriver driver is called New File a new chrome driver. Let's write some code here. That is driver dot manage dot window dot maximize this will maximize the browser as you already know.
And also I'm going to add some time or guys. That is implicit Wait, I'm going to add implicitly which 20 seconds. Unit means time unit. But it's 10 seconds so I can just do seconds or 20 seconds it will implicitly wait. Now how to open the application URL in Selenium. Same thing is okay, no difference.
So driver dot get in this, you have to provide the application URL. Let's say I would like to take this sample application URL that is omega.blogspot.com, copy this URL and paste it into this gate. Now let's do some operations on this. Let's say I want to type some text into this text field and click on this search button. Fine. So for that, let me inspect this text field.
When you inspect this, you'll get this HTML code highlighted for this text field, which has let's there, find out some locators. You see here, it has some name this name is equal to do so using the name locator. We can look at this text field. So name is Q, copy this value of Q, copy this okay name attribute value, driver dot find element by dot name. And what is the value of the name attribute? You okay for that text field and say dot sendkeys In this you can type some text right using syndicates we can type some text, I will type that excess gearbox.com then after that I will do I will click on the search button let's say inspect the search button and here you can see let's create some CSS selector for this okay.
So, for that I will select this input and then say control left so that this text box will will come here. Now I will take this value value attribute value that is such okay now I will say input value is equal to whatever the value or topic Okay, this locating the search button this is the CSS selector guys copy this and now say driver dot find element by dot CSS selector use a CSS selector value that you have just now created and located this using that you have located the search button also. Now set dot click OK once To clicked on this what I will do I will I will wait like this okay so let's wait for this fight or else I will add some thread dot sleep so that it will wait for some five seconds and then I will driver dot which you can use driver dot quit to close the browser now save it.
Now, what I did so far guess first I created a Maven project and I configured this Maven project with the Selenium for right then WebDriver manager also I configure this project with then I created some sample Selenium script which actually looks same in Selenium three also there is no difference right? You can do the same script in rhenium three also. So there is no much difference. Whatever the script I'm explaining right, you can actually run into the Selenium three also okay, but in this session I am going to issue this sample sending him script with this Selenium for watching Didn't alpha three version of selenium four? Okay, so that's the only difference. Now when I run this, okay, so run this demo one dot java, which has a sample Selenium code.
So Selenium four, we are going to exhibit a Selenium for for the first time guys. Okay using Selenium for alpha version three in this video session, select Java application we'll see it will start executing. So the Chrome browser should launch and it should maximize cotton maximize application got loaded and then it has typed text into this text field and clicked on the search button so no match such as uppercase. So and finally after five seconds it got closed. Fine, it is working fine. So so in this video session I thought of before actually I started the website Getting all the new features one of the another one is I thought of actually first explaining how to install and configure Selenium four so that from the next video onwards again, we can get started with all the new features in Selenium four.
Okay, fine. That's it guys. In the next video session I am going to explain how to take elements screenshots using get screenshot as method in Selenium four, alpha four No, okay, it's actually it will belong to Selenium four also. So how to take element screenshot using the ID screenshot as method of selenium four, I'm going to demonstrate as part of the next video session. So that's it, guys. See you in the next video session.
Thank you. Bye