Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Testing Tutorial | Edureka


Hello everyone. Good morning, good
afternoon and good evening. I’m sure people must be
watching this presentation from around the world. My name is Akanksha,
and I’ll be taking this introductory class on Selenium. I’m an instructor with Edureka. All must be aware of Edureka. Edureka is a platform from where you can gain knowledge live online. So, today, I’m gonna cover Selenium. And if I go to the next slide, these are the topics that
I’m going to cover today. So, I’ll quickly go through the slide. Challenges with manual testing. How automation testing
beats manual testing. Selenium as an automation testing tool. Advantages and disadvantages of Selenium. Selenium versus other tools. Selenium suite of tools, as in all the components of Selenium, IDE, RC, Grid, and WebDriver. Hands-on, so we’ll be having a use case wherein I’ll quickly
demonstrate what you can achieve using Selenium WebDriver. We’ll set up environment for the same, and then we’ll have some example for that for any web application. Probably, we’ll take
Edureka as an example. Alright, so, you all must
be aware of manual testing, because when it comes
to attending a course related to automation testing, I’ve seen that mostly people
from manual testing background or those who’ve had automation
testing background as well but they’ve used other
tools, like QTP and stuff, they usually take the scores. I’ll tell you in brief about myself. I’ve been a developer for five years in the beginning of my career. And then I switched to automation testing because I’ve got a chance once to work on automation scripts, and
I totally loved the work. So, that was the time I decided that I’ll be completely
switching to automation testing. So, why is the slide, you must be aware of manual testing? Because, see, the base is very important. You have to have your manual
testing concepts very clear, because automation is, again, automating your manual testing. So, the concepts will remain there. They’ll remain intact. We’ll be just automating them. Okay, so that’s a funny slide, and you can see that
on the left-hand side, we’ve got this registration form with the various sign up fields like username, password, name, address, country, email, sex, language, and then we have to submit it. And there’s this poor guy who’s working on this web application. He’s probably loading these
transactions manually, and he’s all sweat. So, if you see here, testing
web apps manually involves loading all transactions, downloading those transactions, creating pass/fail
reports for each of them, validating the form, taking screenshots for each validation. Poor guy. I’m assuming let’s say he has
to do hundred transactions or maybe thousand transactions. Can you just imagine his life? Okay, so, this is what he’s thinking. It’s boring, it’s time consuming, it’s tedious, and there’s a tendency to make mistakes and errors, because to err is human. And if somebody has to do hundred plus or thousand plus transactions, believe me, even I will
tend to insert a mistake. Anybody will tend to insert a mistake. So, now let’s see how automation testing will take over manual testing. Automation testing beats manual testing. And this guy is all smile now. So, if you look here, it says automated execution
through test scripts. So, that’s a complete hub of systems. Auto generation of results file. So, we are maintaining all
the result files somewhere. And then auto generation of reports. So, we’ve got these
auto-generated reports also. So, that’s the beauty of automation. See, automation is a whole
concept in that sense. If you talk about which
application to automate or how to automate this application. So, if this question comes
up, I would first ask. So, that’ll be my cross-question whether I can automate
this application or not. What kind of application is it? So, the first point is to understand whether we can automate
this web application or not. If it is fine to automate
that application, then comes this slide. Okay. He has automated all the test
cases using test scripts. He’s created an automated test suite, but we’ve got multiple systems
here in this slide, alright. And then we are getting
auto-generated result files. That’s what we can do. We can automate the
result generation as well, and then we can maintain the result files at a particular location, and then we can also also auto
generate the reports to send. So, when we’ll go through
this entire course curriculum, you’ll get to know how to do this. When we’ll reach framework part, you’ll come to know how we can
automate this entire process of auto generating the result files and also creating the reports. Automation testing beats manual testing. So, these are the points how
they beat manual testing. Fast execution. More accurate. Lesser investment in human resources. Supports regression testing. Frequent executions. Supports light out execution. So, let’s understand all
these points in detail. Faster execution. Now, we need to understand
why is it faster. So, you all will think that,
okay, that’s the script, and we’ll just run the script. And that’s absolutely correct, but we also need to understand that writing that script takes time. Only the execution of
that script is faster. So, no doubt, the effort put in initially into creating the automation
test suite is huge. But looking at the longterm effect of creating that automation test suite is so beautiful that we
tend to overlook the effort that has been put in initially. Faster execution. So, we’ve got the steps which are already written inside the script. We just need to run the script,
and we’ll get the result. That’s the reason, fast execution. More accurate, why is it more accurate? Because whatever we
write inside the scripts, they’re predefined. As I already know that
what is my test case and what do I want to achieve, what should the result be, what is the expected result. So, when I create my test script, I will also test my test
script for its accuracy and then I’ll test the test
script for the result as well, which I want to achieve. So, that’s already been
tested and it sell so much that of course we can believe on the result it’s going to give us. Whereas with manual, let’s say I have to hundred
transactions, same thing. If you go back to the same slide, I have to do the same transaction
for the hundredth time. Now, for 99 times, I
didn’t make any mistake, but I got so bored. I got so bored doing the
same thing again and again. But here, I have to just run the script, and those steps need not
be executed manually. It’s a script and I just have to run it, those prerecorded steps. So, that’s more accurate
for obvious reasons. Lesser investment in human resource. Now, if you talk about manual testing and if you talk about
our different companies, okay, I’ve been into corporate as well. So, if we talk about
your manual testing team, strength would be minimum
four people, four resources, and maximum can mean anything, depending on the project size. Now, if I’ve got minimum
for resources also, I’ll have to bring them
from some other project or I’ll have to maybe hire them. So, I’ll be nesting
money in those resources. Whereas with automation, I
need one or two resources to create that automation test suite. Because when it comes
to running that suite, we don’t need any special expertise. That person just needs to know a few steps to run that automation test suite. So, obviously, there’s less
investment in human resources, so we are saving on money as well. Time, we already know,
because that’s fast execution. So, we’re saving on time and
we’re saving on money as well. Supports regression testing. Now, let’s understand what
regression testing is first, and then we’ll see how it
supports regression testing. Now, regression testing,
when I asked my students what is regression testing, they come up with different answers, as in the crux is the same, almost same. But yes, of course, different answers. So, regression testing or let’s
say regression test suite, it’s a test of cases which
will always be there. And those test cases were
written keeping in mind that these test cases will test the major functionality
of the application. We want to check the major flow or major functions or major
components of that application. So, that’s how that regression
test suite is created having major test cases. Now, when it comes to regression testing, it means whenever there’s a bug fix or let’s say whenever
there’s an enhancement, I have to run that set of test cases again because that is testing the major functionality or major
components of the application. And with any bug fix or
with any enhancement, I don’t want that
functionality to be broken. So, these test cases
will remain there always. And whenever I’ll get a
fix, I’ll run the suite. Now, one more point to add, because I don’t want you
to misunderstand things. When it comes to enhancement, enhancement is a new feature. So, if any new feature is getting
added to your application, so don’t think that you
can’t add more test cases to your regression test suite. You can add test cases to
your regression test suite and you can remove test cases from regression test suite. The point is if you’ll
always have a fix number, not a fix actually, but certain test cases that is testing the major functionality or the major call flow, you
can say, of your application. So, now let’s say I’m
working on some application and there’s a sprint that is running. So, I’m working in agile mode, okay? And it’s a 15-day sprint. And those who don’t understand agile, let’s say I’ve got some work, and I have to finish that work in 15 days, and that work is to do the testing. And the developers or
the development team, they’ll fix the bugs. So, now, if I’ve got a bug fixed today, I have to insert that
fix in my application. I’ll get a new build, and then I’ll have to run this
entire regression test suite on that new build. Now let’s say, during that 15 days, I’ve got bug fixes for 10 times. That means that I have to run
this regression test suite 10 times manually, and this regression test suite can have any number of
test cases, believe me, depending on your application. It could be hundred, 150, 200, 250, 300, any number of test cases. Now, if I have to do that
manually again and again, again, the same thing happens. You’ll tend to get more bored. You’ll tend to insert mistakes, or you’ll tend to miss a few steps. What if I automate this entire thing? Because that’s something I’m
gonna run again and again with every bug fix. So, why not automate it? But mind you guys, when
it comes to automation, the first thing that you
should always think is whether it is feasible to
automate it or not, okay? Only when it is feasible to
automate the web application, then comes the point of automating it. Okay? So, don’t misunderstand this that you can automate anything if that has repeated task to do. No, that cannot be done. We first need to come down to this point of whether we can automate it or not. Alright? Frequent execution. Again, these two points are interrelated. If I have to run a test suite which is going to take a few seconds or maybe just a few minutes to complete the entire test suite, obviously, even if I’m getting build for let’s say virtually any
number of times in a day, I can run this automation test suite because that’s gonna
take just a few seconds or maybe a few minutes. So, frequent execution of
the automation test suite. Supports lights out execution. Now, this terminology is technical, which means that even if
you’re not physically present in front of this testing happening, it will happen anyway. With manual testing, you
have to do it manually. But with automation, you just
have to run the test suite. So, even if you’re not there, maybe you’re attending
some important meeting or you’re running some
very important test case, which is a different thing altogether, or maybe you’re working
on some different project. So, this is the power of automation. You don’t have to be manually
there, physically there. You’re saving on time,
you’re saving on money. So, so many things you can achieve. Let’s go to the next slide now. Selenium as an automation testing tool. Now, the number of tools that are being used in the market, Selenium is taking over
all of them, believe me. So, there are certain features or certain plus points,
positive points of Selenium, which is making it dominant
over other tools in the market. Selenium is a suite of software tools to automate web browsers. It is open source and mainly
used for functional testing and automation testing. It’s a suite of software tools
to automate web browsers. Now, if you say Selenium is
a suite of software tools, basically, we are talking
about Selenium as a whole. So, you must have already heard that Selenium has got Selenium web driver. It has got Selenium IDE. It has got Selenium Grid, and it has got Selenium Remote Control. It had actually, but it’s
obsolete, it’s deprecated now. But still, it had. Now, there’s so many tools in it. We’ve got these four components
which will help us automate web browsers or web applications. It’s open source. The biggest reason why people
are preferring Selenium is this point. It is free of cost. It’s open source. Now, even if I have to
learn Selenium at home, I don’t need any license to buy it. For QTP, you need a license. With Selenium, you don’t
need to buy any license. You can download Selenium
jars on your personal desktop and start practicing, start working with e-commerce website, so any website that’s available on web, whether you are in
United States or in India or any part of the world. You can test the web
applications on your own. So, that’s the biggest reason why people are preferring
Selenium over other tools. It is open source and mainly used for function testing
and automation testing. So, I’m sure you all must be
aware about functional testing. So, if you have to do, obviously, this functional
testing will also be automated. Okay. So, writing functional
testing and automation testing basically means that you can use Selenium to automate functional
testing or regression testing. Supports different PL. PL means programming language. I’m now talking about other
features of Selenium, okay, which again are the
reasons of Selenium being dominant over other tools. It supports Java, Python,
Perl, Ruby, C#, C, JavaScript, and I think a few
must not be mentioned here. Supports different OS. So, whether you talk about Linux, whether you talk about
Windows, any version, whether you talk about Mac, whether you talk about iOS, whether you talk about Android, whether you talk about Ubuntu, all major operating systems
are supported by Selenium. Supports different browsers. Now, there are just five mentioned here, but all majors browsers that
are available in the market, Selenium has given
support for all of them. So, here we’ve got
Internet Explorer, Firefox, Chrome, Safari, Opera. Now, you have other browsers as well. Selenium is providing
support for all of them. Now, just imagine, even
if you’ve got a system, okay, which has got Ubuntu. I’ll give you an example. Now, generally, people don’t use Ubuntu for their personal system
as an operating system. But let’s say you’ve
got your office laptop, and that’s what you have. You can carry it to your home
and Ubuntu is installed in it, but you have to practice Selenium at home. Leave about office, but you have to practice Selenium at home. Selenium is giving support
for Ubuntu as well. You can run Selenium on Ubuntu as well. You’ve got Linux on your system. Selenium is giving it support and let’s talk about the
programming languages also. Now, C. I understand that manual testers don’t have any programming
language knowledge, which is fine, guys,
which is absolutely fine. Now, if you have to write, if you’ve chosen automation
testing as your career choice, obviously, you must have
thought in your mind that you need to learn
some programming language. You’ve got so many options. You can learn Java. You can learn Python, C#,
PHP, Ruby, Perl, JavaScript, anything, and you can work
with your Selenium scripts. Okay. Alright. So, let’s say, okay, we’ve got some audience as well at the backend, and they wanna understand the difference between functional testing
and automation testing. Now, I think this line
shouldn’t be written this way first of all, functional testing and
not to mention testing, because you can automate anything. Anything as in you can
automate functional testing and regression testing. Functional testing and automation testing, you can automate your
functional testing as well. Now, let’s talk about functional testing, because I understand you must be knowing what automation testing is. Let’s talk about functional testing. Now, regression testing, you know how we do regression testing. Functional testing is
dividing your test cases on the basis of components or call flow. Your application could be of any type. It need not be an e-commerce necessarily. It can be any kind of web application, and there’ll be some functions, there’ll be some call flows. So, functional testing will be basically test those call flows. Let’s say you are signing up, you’re signing up on a web application. So, the first thing that’ll
come on the application is the signup form. Now, you’ll fill the signup
form, you’ll submit it. That record will get stored in the database of that web application. Okay. And then maybe you’ll get a prompt that your credentials or your details have been saved successfully. So, that’s a flow, okay? Filling the form, your details
going back to the database, and something being returned. So, I want to test that entire flow. So, I can do that in functional testing. Okay. Now, when it comes to automation testing, you can automate functional testing and you can automate your
regression test suite as well. Automation testing is
that you have to write scripts to run some test cases. Now, for this automation testing, you can have individuals
scripts for practicing. But when it comes to real time, you actually need to create
automation test suite. Okay. And how do you clear the test suite? By having frameworks
or by taking frameworks into your project, or creating frameworks. So, we’ll come to that
framework part later. Let’s go to the next slide. And I hope you’ve understood the features that makes Selenium one of the best tools for automation testing. Advantages and disadvantages. So, we are also mentioning
the disadvantages here. Let’s understand those as well. We’ll talk about disadvantages first, and then we’ll talk about advantages. Supports only web applications. Now, it doesn’t support
mobile applications. Okay. It supports web applications. And it doesn’t even support
any desktop application. So, that’s there. Selenium only supports
your web applications. Only user communities available. Now, people say that’s a big drawback. Because if you talk about QTP and if you talk about
other tools, alright, major tools that are being used in the market today for automation, they’ve got a dedicated support. Let’s say for QTP, HP is giving a dedicated support for QTP, but here we don’t have
any dedicated society wherein we can put in our queries, or, you know, we can get a result or we can get an answer. We’ve got thousands of blogs. People have been working
with Selenium for long now. And believe me, they’ve
loved Selenium so much that they’re writing their own blogs. They’re creating their own
web pages with the tutorials. So, that’s there. You will find knowledge. I mean, you’ll find something on the web, but there’s no dedicated
society or community for it. Now, seleniumhq.org is one place where you can believe on the documentation because that’s directly coming from the developers of Selenium. So, you can trust that, but that’s just a documentation. You won’t find any thing in detail or you won’t find programming there. Difficult to set up and use. I don’t find it difficult to
set up and use to be honest, but, okay, let’s say it’s a disadvantage. I don’t find it as a disadvantage, but let’s say it’s a disadvantage because if you’re working with a
programming language, okay, you need some development environment. Selenium doesn’t provide
any development environment, which means IDE, integrated
development environment. So, you would need to use some other IDE, let’s say Eclipse. So, if you want to write
your scripts in any IDE, you need to do some set up, which you’ll have to do for
any programming language. Okay, so that’s there,
you’ll have to set up. You’ll have to provide things wherein you can write your scripts. So, difficult to set up and use. Why use, because, again, I believe that’s the programming language thing. You need to have prior
programming language knowledge, so be it Java, Python, Perl,
Ruby, JavaScript, C#, anything. You’ll need to have knowledge
of the programming language. No reporting facility. Now, I consider this as a disadvantage, because in WebDriver which is basically used by all the companies, we don’t have any reporting facility here. You even need to include
that reporting thing in your framework by automating this, or you’ll have to use third
party tools like TestNG. So, you’ll integrate TestNG along with Selenium
WebDriver to get the reports, an HTML format probably. Okay. So, we’ve got a question
that doesn’t support. Alright, let me just read the question. So, this is from our audience. So, it says, “When you
said Selenium is used “only for web testing and
doesn’t support mobile testing, “how can it support Android
and iOS operating systems?” So, I don’t know why you’ve
written iOS operating system, but when I’m saying
that it doesn’t support mobile applications. So, you all know that
mobile apps are different. I’m not saying that you cannot open any application on mobile
and cannot test it. Okay? What I’m saying is you cannot use Selenium for mobile app testing. Of course, you’ve got a browser. You can open Chrome on
your mobile as well. On that, you can do the testing. That, I’m not denying. But if I have downloaded, let’s say I’ve got some application. Let’s say I have downloaded Mantra, anything as a mobile application that you cannot use, that you cannot test. We’ve got other tools
like Appium and stuff for doing that kind of testing. Okay, alright. Limited support for image-based testing. Now you can take a screenshot
using Selenium, that’s there, but you cannot compare two images. Let’s say for any kind of verification, you want to compare two
images for verification. That is not there in Selenium. You of course can take screenshots, but you cannot compare two images. So, these are the disadvantages. There are others as well,
which are not listed here. We can talk about them,
and we’ll face those issues while working through the entire course. Okay. These are the advantages,
let’s go through them now. Open source software, the biggest, biggest reason
why people prefer Selenium. I also learn Selenium on my own. How did I do it? I downloaded Selenium jars and
I started working with them. And they were so interesting. I started practicing for hours, because I could do that
on my personal system. So, that’s the biggest reason people are preferring Selenium. It’s free of cost. You can download Selenium
jars on your system, import them in your project, and start working with them. Supports multiple programming languages. So, we’ve already seen that going. You talk about Java. You talk about Ruby, Python. You talk about Perl, PHP, C#. I hope I’m not missing anything, any programming language. You talk about major programming language and we’ve got support
for it from Selenium. Next one, supports almost
every operating system. So, as I’ve already told you, whether you’ve got Ubuntu, whether you’ve got any version of Windows, whether you are using Mac, whether you are using Linux, you’ve got a support for it. Support multiple browsers. So, let’s say you prefer
to walk with Chrome. Okay, that’s your choice. It’s my choice as well. So, Selenium gives support for it. Then somebody has a
preference to use Firefox. You can work with it. You can work with Selenium on Firefox. Somebody has got a Mac system. Okay. You can work on Safari as well. Now, we’ve got HtmlUnit. I’m not sure if you’ve
heard about it or not. That’s a headless browser which doesn’t have any GUI,
graphical user interface. It’s a headless browser. We call it headless browser, HtmlUnit. Okay. Now, Selenium supports
this browser as well. So, we’ve got support for
all the major browsers available in the market. Supports parallel test execution. Now, that’s a whole concept in itself. I’m not gonna take it in detail, but I’ll just let you understand what parallel test execution is. Now, this parallel test execution can also include the term
called cross browser testing. So, parallel testing means you’re running the same test case parallelly on different browsers. That’s cross browser testing, and you can call it parallel also because you’re running
the test cases parallelly. You can run different test cases parallelly on different
instances of the same browser. Listen to me carefully, because parallel can be
running test cases parallelly, but it depends on you
how you want to run them, whether you want to
run the same test cases on different browser, or whether you want to
run different test cases just to speed up on different instances of the same browser. So, that’s parallel testing, and we can achieve parallel
testing by implementing TestNG along with Selenium WebDriver. We can achieve parallel
testing by using Grid also. So, when I’ll come to Grid portion I’ll explain how beautiful it is when it comes to testing
your test cases parallelly on different kinds of systems. When I said different kinds of system, it means having different
operating system, different browsers. So, that’s another feature. Provide support for framework, TestNG, JUnit and NUnit. So, these are, again, testing frameworks. So, when TestNG combined
with Selenium WebDriver, it will take over the
disadvantages, majorly this one. We don’t Have any reporting facility. With TestNG, I can get
well-formed HTML reports. Now, parallel execution, if I want to run my test cases parallelly, I can take help of TestNG. JUnit is, again, your Java
Unit testing framework. Okay, that’s basically
used by your developers for unit testing purpose. And NUnit is, again, this
same thing, like JUnit, but it’s used for C, for
a different language. So, these two are basically used by developers for unit testing purpose. TestNG which is called
Test Next Generation, that’s an advanced version
you can say of JUnit, with added features and functionalities. So, when we’ll come to TestNG, we’ll take this in detail. Let’s go to the next slide now. Selenium versus other tools. So, here we’ll be discussing
three different tools, QTP, IBM RFT, and Selenium, and we’ll compare all of them on the basis of a few features. License, required for QTP and IBM’s RFT. Selenium is open source. So, these two points, license and cost, they’re interrelated, because the major cost
goes into licensing. See, all three of them
are automation test tools. Okay. So, when it comes to
putting in the effort, when it comes to using human resources, it’s one and the same thing
for all three of them. But when it comes to licensing, costing in terms of license, for both of them we need, but for Selenium it’s free of cost. So, that’s the reason cost
is high here and less, because it is open source. Customer support, we’ve
already discussed this. For QTP and RFT, we’ve got
dedicated HP support for QTP, and for RFT, we’ve got
a dedicated IBM support. But Selenium is an open source community. We don’t have any dedicated support. Hardware resource consumption
during script execution. That’s high here. Now, I haven’t used QTP and RFT, so I really can’t comment on this part that how hardware resource
consumption is high here. Okay. Selenium has always been my choice. I’ve always loved to work with Selenium. It’s low here because all you need is your personal system as far as your hardware is concerned. Okay. And you need to have an IDE, that’s it, and your programming language of course and you can start writing your scripts, download your jars, and
start writing your scripts. So, we don’t need much. We just need one setup, that’s your personal system,
your PC or your laptop. Coding experience. It’s not much for QTP. For RFT, it is required. And for Selenium, it
should be really good. It should be very good along
with technical capabilities of integrating the framework. Integrating is the second thing. For even writing the scripts, you need to have programming
language knowledge. So, it’s my advice that if you think that you want to Selenium,
you want Selenium as your, automation as your career
choice, using Selenium, start working on your programming language concepts parallelly. That’s very important. Environment support. We can run QTP only on Windows
and RFT only on Windows, but look at this. Windows, any version
of Windows, believe me. Linux, Solaris, and it says if browser and JVM or JavaScript support exists. Now, that’s there. Obviously, we should
have web browser support for these operating systems. There are just three mentioned here. You can have Mac, you can have Ubuntu. Okay. All the major operating systems
are supported by Selenium. Language support. QTP, for this, we need
VB Script knowledge. For RFT, we need Java and C# knowledge. But if you want to write
your scripts in Selenium, if you have knowledge in any
of these programming languages, you can work with it. The features are so good that obviously anybody would love to work with it. This is not a drawback,
open source community. It could be in a few scenarios and in case of major bugs, okay, but I haven’t felt that
there’s any major bugs so far. I haven’t come across any major bug here. But even if there’s an
open source community, believe me, you’ll get the answers. Let’s say you stuck some there. You just Google it, and you’ll
get millions of answers. So, it could be a drawback,
but not that major. And these points, obviously,
are taking over QTP and RFT. Let’s go to the next slide. Selenium suite of tools. We’ve got four components
of Selenium here, okay, IDE, RC, WebDriver and Grid. And before I go ahead with this, let me just mention that
RC has been deprecated. From Selenium 3 onwards, which is the latest version of Selenium, so there was a lifecycle. Okay, we had 1, Selenium 1. We had Selenium 2, and
now it’s Selenium 3. And Selenium 3, RC has been deprecated and has been moved to a legacy package. Okay. IDE, RC, WebDriver, and Grid. So, version one had IDE, RC, and Grid. There was no WebDriver in Selenium 1. Version two had IDE,
RC, WebDriver, and Grid. Version three, IDE, RC,
WebDriver, and Grid, but then you can consider
it not being there as well, because it’s been deprecated now. We’ve mentioned this here for the reason that there might be
people around the world who are still using RC, but that’s moved to a legacy package now. Alright. I’ve never used RC. I’ve been using Selenium
for a long time now, but then I’ve never used RC. So, it’s been years. People gave up on RC
because of its drawbacks. So, I’ll come to that when
we’ll discuss the difference between RC and WebDriver. Let’s go to the next slide. Okay, so that’s about IDE. Selenium IDE is a Firefox plugin which is used to create
and execute test cases. IDE is integrated development environment. And if you read this line
carefully, it’s a plugin, which comes only for Firefox, which is used to create
and execute test cases. So, you can create and
execute test cases here. I’ll just quickly give
you a demonstration. Let’s go through the slide now. It records and plays back the
interactions with the user, sorry, which the user
had with the web browser. Record and play. We also call it a record and play tool. Why, because let’s say
you open up this plug In and you’re working on any web application. Whatever you’re doing
on a web application, it gets recorded as the
steps inside this IDE. So, that’s called recording. Now, you can playback these steps again. So, we’ve got these two buttons. If you can see here,
there’s a green button here with a single hash, and
there’s one with three. So, that’s for a single test case and that’s for test suite, okay. we can run these steps,
again, using these buttons. So, I’ll just demonstrate
that in a few moments. Using IDE, you can export
the programming code in different languages. Now, that’s a good feature in IDE. I don’t prefer to use IDE. I’ll tell you about that,
why I don’t prefer using IDE. But yes, this is a good feature. Let’s say for syntaxing or
let’s say for prototyping. You want to understand how should I write a code for executing a
test case in Selenium. Execute the same test
case using Selenium IDE, record these steps, okay, and then we’ve got an export feature here. Using which, you can export these steps in a programming language format. So, you’ll get the entire script in that particular
language that you choose. So, no. So, we’ve got a question. Can’t we use Selenium IDE in Chrome? No, you can’t use. That’s a Firefox plugin. It comes only as a plugin for Firefox and not any other browser. Alright? Okay. So, let me quickly check what
is there in the next slide, and then I’ll give you a demonstration. So, these are the features. Before I come to the features part, now let’s quickly see what IDE is. So, I’ll just open up my Firefox now. Now, first of all, I’ll tell
you how to get IDE, okay? Don’t go here and go to
plugins for getting IDE. Please don’t do that. What I want you to do is just write down or maybe you can directly
go to seleniumhq.org. Okay. That’s what… This is the link which you
can support for documentation, which you can trust for documentation. Go to this one, because all the documentation here, it’s coming directly from
the Selenium developers. So, it’s trustworthy. Now, go to Download here, and you might just have to
scroll down a bit to find IDE. Okay, it’s right here. Now, can you see that Selenium IDE? Download latest release version
from addons.mozilla.org. So, you’re supposed to
get IDE from this link, and not through the menu here. Click here. It says Add to Firefox. I already have it, so I’m not
gonna click on Add to Firefox. If you want to get Selenium
IDE in your Firefox, just click on this button. It might ask you to restart Firefox. Restart, and you’ll get
an icon looking like this. Can you see here? That’s Selenium IDE. Now, what I’m going to do
is I’m going to click on it. A plugin window will get opened up. So, that’s exactly what we
just saw inside this slide. This is another window. It’s a plugin for Firefox, okay. You have this record button, which is already enabled. If you can read it, Now Recording,
Click to Stop Recording. That means whatever you’ll
do in a Firefox browser, this tool or this plugin is going to record it in steps, and then these are the
buttons to play them. So, what I’m going to
do is I’ll pull it down. Okay, I’ll just minimize it. We’ll do something on Firefox, and let’s see what gets recorded here. So, let’s say I’m gonna open Amazon okay. Now I’m opening Amazon, and then let’s say I’m
going to Today’s Deals. I’ve got Today’s Deals here, and let’s say I want to click on Books. So, I’ve selected Books here. Okay. And I’ve got these books. Now, let’s open up what
has come up in IDE. Can you see? They’ve got a few commands here. These are called Selenese commands, because IDE is written in
a language called Selenese. I don’t remember the developer’s name. He’s a Japanese person,
and he created IDE. There’s not one person who’s created the entire Selenium Suite, okay? There are different people involved, and we’ll get to know about them. So, this one, IDE was done
by some Japanese developer. I don’t remember his name now. So, these are Selenese commands. Open, click, clickAndWait, and click. Okay, so this URL. There’s this URL here. And when you click on these commands, you get the reference. You can read the reference
on this window here. I’ll just maximize it for you all. Okay. So, if you click on any of the commands, you’ll get to know what
this command is all about. This open URL, it says argument is URL, the URL to open may be
relative or absolute. Opens up a URL in the test frame. This accepts both
relative and absolute URLs and the entire detail about it. Now, let’s say I want to
choose this one, click. So, the argument is locator
and element locator. Clicks on the link button,
tick box, or radio button. So, that can be anything
which you can click on, right? This basically performs a click. So, it can be a link also. It can be a button also. It can be a radio button. It can be a checkbox, anything. ClickAndWait. Clicks on a link button
checkbox or radio button. If the click action
causes a new page to load. Read this carefully. If the click action
causes a new page to load, call waitForPageToLoad. So, that’s been done internally, okay. If it knows that this click
has happened on a link which is opening another page, it is going to wait for
that new page to get loaded. Alright, these are Selenese commands. Now, let’s say I want to
run these steps again. How do I do that? I can click on this, play current test case. And you can just stop it here. So, I’ve stopped it, which means these are my recorded steps. And if I want to play these
steps, I’m gonna play them, and please pay attention on the browser. Okay, that’s your Firefox. I’m gonna play them. Please pay attention. So, it has open up Amazon. It should click on Today’s Deals now. Right? And then I think I chose Books, so it should check this checkbox. So we’ve got the books now. So, it records and it plays back the recorded steps. That’s what IDE is about. Now, there’s more to it. Alright? You just saw in this slide that we can export the test cases. If you want to save the test case, you can save the test case. You can save it as also. You can do that on your own. Let’s understand the Export feature. That’s Export Text Case As. Just look at the option. Take a few seconds to read these options. So, it is providing support
for C#, Java, Python, Ruby. I will be telling you
about Selenium WebDriver along with TestNG and Java. So, I’m gonna use Java. I’m gonna use Selenium WebDriver, and I’m gonna use TestNG. Let’s say I want these steps
in that language format. I will use this option,
Java, TestNG, and WebDriver. Let’s say I have chosen this. It is asking me to save this file. I think I clicked on it twice. Let me just close this. Okay. And I want to name it as Edureka. Okay. And Amazon, _Amazon. And I’ll save it. Okay. I’ve saved it. Now, that was saved in
this folder, Edureka, and the name was Edureka_Amazon. So, if you see here,
there’s Edureka_Amazon.java. I did not give any extension to this file. And if you open it,
that’s a whole Java file using Java, Selenium
WebDriver, and TestNG. These at the rate sign,
if you see here and here, okay, these are TestNG annotations. So, you won’t understand
the annotations as of now, because we haven’t gone through TestNG, but this is coming because I
chose TestNG as the option. And of course you understand
that this is these functions and these classes that’s a Java concept programming language. And these functions, driver.manage, or driver is equal to new FirefoxDriver, or maybe declaring this WebDriver driver, which is a private instance. This is coming from Selenium. So, this is a full fledged script. Now, people ask me that
why can’t we use IDE. No, guys, if you want to use IDE, you’ll never learn Selenium. You can use IDE if you want
to do some prototyping, you want to prototype your project, or let’s say you want to
understand the syntaxing. If I’m using, let’s say alert handling, how should I handle it? So, that can be done here. For that purpose, you can use them. But if you’ll just rely on these scripts, you can’t learn Selenium. Plus, there are other
things also which you can’t do with Selenium. You can’t do your regression testing or the entire functional testing. Okay, you can run small scripts, you can create small scripts, but you cannot do a full
fledged testing here. And it’s clearly written. Even if you go to the
documentation on seleniumhq.org, it says that it’s basically
for prototyping and syntaxing. Don’t prefer it for a full
fledged testing, right? Plus, there are other things also. Let’s say you want to do looping, looping as in you want to perform
something again and again. You can do it with Selenium. You can take a screenshot here. Plus, let’s say you want
to do data-driven testing now, data-driven testing is when you want to provide
data set for your testing. You can do it here. You can provide the whole
data set here for testing. So, when it comes to Selenium
IDE, I tell my students, please keep it limited. You can use it. There’s no harm in it, but don’t make it a choice. Alright, let’s go back
to the slideshow now. Okay, so that’s the IDE features. Create and edit test cases. Okay, you can edit them also. I’ll just show you how you can edit them. So, you’ve got this, right? You’ve got a command and
you’ve got it talking. Now, you can edit this. You can add a value to it. You can, you know, maybe
change this command. So, you can edit the script as well. You just have to click on that command and you’ve got these three fields, right? Let’s get back. Create and execute test suite. So, you saw that there were two things. There was the screen
button with a single bar, and there was green
button with three bars, green bars, right? So, that was for playing
the entire test suite. So, let’s say if you want
to have multiple test cases, you run multiple test cases, save them, then add them as a new test suite. So, you’ve got that option also to create a new test suite there. Debug and enhance test cases. This and this are almost the same. You can debug them, you
can enhance the test cases. You can add more steps to them. Test cases can be exported to different programming language, thus you already seen, and I think that’s the major thing that you should know about IDE. Enables learning of
Selenium’s script syntax. So, like I mentioned, when it comes to syntaxing or prototyping, that time you can use Selenium IDE. But when we’ll get to web driver, believe me, you’ll forget IDE. You’ll forget IDE. Initially, it’s okay to just understand, okay, if I’m executing these steps, how would they look? How would these steps
look inside a JavaScript? For that purpose, you
can use it initially, but don’t make it a choice. I’ll keep that repeating. Alright, let’s go to the next slide. I believe there are no
questions from the audience, from the current audience. These are the drawbacks, let
me complete this as well. Supports only Mozilla Firefox, so that’s a plugin for Firefox and it doesn’t come as a plugin for any other browser. Not suitable for dynamic web applications. Why is it not suitable? See, what is dynamic? Dynamic means when something can change at any point of time. It’s not static. It’s not gonna remain
the same all the time. It’s gonna change dynamically. Now, that dynamic thing
could be the entire page or it could be a few
elements of the page, right? Now, we cannot handle dynamic elements using Selenium IDE, because let’s say for security reasons, I am dynamically changing the HTML IDE of my password field in a login form. Just an example. So, if I have to log in
on that website using IDE, I can’t do that because the next time that prerecorded script inside IDE will run that test case, it’ll fail, because the id will change. Whereas when it comes to WebDriver, we can handle dynamic elements very well using xpath and its features, xpath functions. So, we’ll come to that later when we’ll understand finding elements and details. No support for programming
logic or a language. It automatically, you can’t
write your own scripts. You can export scripts, but you cannot write your own scripts. It’s an IDE. It’s not a programming interface, okay? It’s an IDE. Data-driven testing not possible. That I mentioned that
you cannot do testing, then you have to provide a data set. Let’s say you want to give
hundred user IDs and passwords, and you want to test the login form. That cannot be done using IDE. No centralized maintenance
of objects and elements. Now, that’s a huge point, as
in you first need to understand what are objects and elements. Then only you can understand what do you mean by no
centralized maintenance of objects and elements. So, I’ll briefly tell you right now. Then when we’ll get to WebDriver, I’ll tell you about objects
and elements in detail. Anything that you see
on a web application, I’ll give an example. Let me open up Chrome. So, let’s say I’m opening ebay.in, okay? Now, that’s a whole page
with various elements, elements as in the Sign In link. This Register link is
an element of this page. These links, Deals, Sell, Help
& Contact, Track My Order, My eBay, My PaisaPay, this cart icon, the search button, this dropdown, this list in the dropdown, okay, these options in the dropdown. These images. All of them are elements of this web page. You can also call them objects. Okay. We’ll talk about them in detail later. These are called elements of the webpage. Let’s go back to the presentation. No centralized maintenance. So, we do not have anything that maintains these elements. No centralized location. Now, when I’ll be telling
you about finding elements, I’ll be also talking about HTML document, DOM, which is called
data object model, okay, which actually is the entire model of the objects of the webpage. So, we’ll talk about those
things in detail later. For now, you’ll understand
there’s no repository, wherein you can save these elements or objects on the webpage. No centralized repository. So, these are the
drawbacks of Selenium IDE. Okay, we are coming to the
next component of Selenium. Selenium Remote Control is used to write web application tests in
different programming language. But what is Remote Control? So, that’s an entire thing
we need to understand. Just what was RC, how
it came into existence. Let’s go to the slide. And before I explain this slide in detail, I’d like to explain the difference between RC and WebDriver for which I’ve created a document for my students. Okay. So, I’ll explain that document, and then we will understand
the slide in detail. Selenium remote control is used to write web application test in
different programming language. So, that was also an interface which was letting us
test web applications. It interacts with browsers with the help of Selenium RC Server. Now, that’s again a new thing. You won’t understand it. RC Server communicates using
simply HTTP get/post requests. Drawback is that every
communication with RC Server is time consuming and hence RC is slow. But why is it time consuming? I’m gonna explain that. Selenium 3 onwards, RC has been deprecated and
moved to a legacy package. That’s an important point about RC. See for your knowledge, or maybe down the line
if you get this question in your interview. For that purpose, I’m gonna
explain the difference between RC and WebDriver. Otherwise, guys, believe me, you don’t need to get into
the intricacies of RC. It’s been deprecated, nobody is using. I believe nobody would ask any question. They might just ask you the difference, but they will never ask you what RC was, how to write the functions there. I have never used RC. I’ve been working with
Selenium for years now. So, I’ll just quickly open up my folder. Okay, so, I’ve created
this one, RCvsWebDriver. I’ll just go through the
first few paragraphs, so that you understand the difference. Now, what will I do? I will read every paragraph first, and then I’ll explain it. Okay? Alright. Jason Huggins realized. Now, before I read this line, let me introduce Jason Huggins to you. He was the developer of the
first Selenium JavaScript, Jason Huggins. Okay? Jason Huggins realized that
the repetitious manual testing of their application was becoming more and more inefficient. So, this, he was a tester, okay. And he had created a script. But before he created the script, he was testing his application and was running a few steps
which were repetitious. So, he thought that this was
making my testing inefficient. It was wasting my time. Alright. So, he created a JavaScript program. Understand this, that’s why
I’ve highlighted these points. He created a JavaScript program that would automatically
control the browser’s actions. You understand this point? Automatically control browser’s actions. If you don’t know your browsers, the language behind your
browsers is also JavaScript. So JavaScript can very well
control your browser’s behavior. So, what he did, he created
a JavaScript program, so that using that script, he can control the browser’s actions. That’s how he was trying to automate the manual testing part. He named this program
as JavaScriptTestRunner. So, that was the name
he gave it initially. Now, looking at the
potential in this idea, to help automate other web applications, he made it open source
which was later renamed as Selenium Core. So, this JavaScriptTestRunner actually became Selenium Core. So, if anybody ask you what
was the very first thing that came into existence, Selenium core was the first thing that came into existence
in Selenium’s life or Selenium’s life cycle. It was not the RC Server. It was Selenium Core, okay? And what was it? It was a JavaScript program. Now, let’s understand what the same origin policy issue was. So, what I’ll do, I’ll create
a notepad so that you remember how this entire thing came into existence. So, first it was a
JavaScript program, right? JavaScript program. And what was it? It was called Selenium Core. So, Selenium core was
the very first thing. I’ll just expand it. Okay. Now, let’s read the next paragraph. The same origin policy issue. It prohibits JavaScript code. Understand it. It prohibits JavaScript code from accessing elements from a domain that is different from
where it is launched. I’ll read it again. Same origin policy prohibits JavaScript code from accessing elements from a domain that was different from
where it was launched. What does this line mean? It means, let me open up something. I’ll close this now guys. Okay. And I’ll open up Firefox. Now, let me open Google. Okay, google.com. And I’m gonna open Firebug. I’m using Firebug to inspect elements. Okay, we’ll talk about these plugins. So, I’ve downloaded Firebug. Let’s say I’m gonna inspect this. I’m taking this example. I’ve just taken it arbitrarily. It’s not that it’s my choice, so I’ve just taken it. So, I’ll have to find out. Alright, okay. Now, that’s an entire HTML
code if you can see here with head and body, right? So, generally has your title and stuff, and the body has the visible page content. So, that’s the body, having
visible page content. We’ve got different
divisions, we’ve got scripts, we’ve got styling, we’ve
got internal divisions. So, if I just scroll it down, you will see as when I hover mouse on various HTML elements, okay? Something is getting highlighted, right? And then you come to this, which is highlighting the entire page, and then that’s selecting this div, so it is highlighting
only this middle thing. This entire HTML document
is basically this page, the HTML code for this page. This point regarding same
origin policy is saying that if you’ve got a JavaScript, JavaScript is not allowed to access any element from another webpage that is beyond this domain. So, what is my domain? My domain is google.co.in, and I’m on the Search page, right? Now, Google has got a number of things. It has got Gmail which is called mail. Okay, it has got other
applications as well. So, what I’m trying to say is if you’re working with google.com, from any JavaScript within this page, you cannot access elements of yahoo.co.in. That’s against the same origin policy. According to same origin policy, you will never be allowed to write anything within the script, which will access elements on yahoo.co.in. Why, because it’s not
under the same domain. Now, if you’re working in the same domain, let’s say you’re working with google.com, so whether you’re working with search, whether you’re working with images, whether you’re working with Google Drive, whether you’re working with Gmail or any other page within google.com, it can be allowed. But if you’re going beyond this domain, it will not be allowed, okay? So, this was same origin policy issue. I just read this paragraph, okay. HTML code in google.com
uses JavaScript program randomScript.js. Now, I’m not certain about that. I just took it from the web. The same origin policy will only allow randomScript.js to access pages or elements within google.com, such as google.com/mail /login /signup. But if you want to
access pages or elements from different sites,
such as yahoo.com/search or anything else, you won’t
be allowed to do that. Why, because both of them
are in different domains. So, this was same origin policy thing. Now, why have I explained
same origin policy? Because that was the
drawback with Selenium Core. It was a JavaScript program
which was hacking your browser. Why, because through that program, Jason was trying to control
the browser’s actions. Now, even browser needs to understand whether the script which
has been inserted inside me, and the web application
along with the web server that I’m going to control, which is going to run
over me on this browser. They’re under the same
domain or not, right? So, let’s just go to the next paragraph. And if you want to learn
about this in detail, okay, you’re more than welcome to go through the wiki pages
of same origin policy thing. Now, if you can see here, this diagram is again taken from the web. These are the HTML pages
in some domain called ABC, and there’s a JavaScript
controlling these pages. But if you try to control this page inside domain XYZ through this
JavaScript, you can’t do so. That’s what same origin policy is. This is the reason. Listen to this very carefully. This is the reason why
prior to Selenium RC testers needed to install local copies of Selenium
Core, a JavaScript program, and the web server containing the web application being tested. So, that belong to the same domain. So, what will these testers require to do? He made it open source. Jason made it open source, Selenium Core. But the thing is we needed Selenium Core and the web server along
with the web application on the same system. That’s not always possible. So, this was the issue in Selenium Core. Now came the existence of
Selenium Remote Control, okay? Now, unfortunately,
testers using Selenium Core have to install the whole
application on the test and the web server on
their local computers. Because of the restrictions
imposed by same origin policy. So, another ThoughtWork engineer, that’s what I said in the beginning. There is a whole team involved. There’s not just one person. There’s a whole team involved behind the Selenium generations, okay? So, Jason Huggins created Selenium Core. Then another ThoughtWorks
Engineer called Paul Hammant, he created your Selenium RC. So, the next thing was Selenium RC which came into existence. And what was RC? It was a server. Selenium RC, which is Remote Control. I’d rather write Remote Control. And what was it? It was a server. You can call it a standalone server, because I’ll tell you in
a while what it was doing. Decided to create a server
that will act as an HTTP proxy to trick the browser into believing that Selenium Core and the
web application being tested come from the same domain. The system became known as Selenium Remote Control Selenium 1. I’ll repeat this line again. Paul Hammant, what did he do? He created a server, okay? This was a server. It could be a standalone application. What was the server doing? Before running any test case,
he had to start the server. And after starting the server, what was happening? This server was actually
inserting an HTTP proxy to trick the browser. Okay? Where does the proxy go? Proxy goes into the browser to trick the browser
into believing that Core and the application on the test, they are coming from the same domain. Now there’s an entire history behind it, how to do this, okay. Now, I’m not going to explain
that part, how it does that, though I’ve mentioned it in this document. Probably, I can upload it if possible. Okay, I’ll upload it. I’ll try and upload it. So, how it did? This HTTP proxy injection was
happening inside the browser. So that your browser understands it was tricking the browser into believing that Core, your Selenium Core, and your web application on the test, they’re coming from the same domain. Now, when this thing is over, okay, when your browser can understand, “Okay, fine. “Both of them are coming
from the same domain.” no matter whether your
application on the test and your Core are on the
same system, local computer. But still, since we’ve
injected this proxy. Because what this proxy will do, it’ll create a fictional URL. So, that’s a whole concept. It’ll create a fictional URL, so that this URL, when this URL is called, it will be believed that Core and your URL or your web application, they
are under the same domain. That’s how your RC came into existence. Now, why is it called that
RC was a slower system? RC was a slower system
because if you look at this, you need to first start the server, so that this HTTP proxy gets injected. Now, if you’ve started the server and then you’re providing
the instructions to whom? To Selenium Core. And Selenium Core is passing
the instructions to browser. So, it was the whole cycle. First, server will restart it. Then the instructions from
your script will go to Core, and Core will provide the
instruction to browser. There was also no direct communication. So, this entire process was very slow and hence taking time. Okay, I’ll just back to the slide. And we’ve got a few questions as well, so I’m gonna take that up as well. Alright. So, because of this,
the system became slow. Alright. So, we’ve got a few questions. Let me just expand it. We have some audience here. Raul, do you want me to explain
same origin policy again? I would rather prefer that
you go through the wiki page because that explains it beautifully, what same origin policy is, but I think I’ve covered this
part that how it is denied, that you cannot access any page or HTML code from a different domain, inside the domain which
you’re currently working. Raul, do you get it, or do you want to explain it again? Alright, no answer. So, what we’re going to do, we’re gonna quickly go through the slide. RC Server, okay, that’s the basic thing. RC Server communicates using simple HTTP get and post request. So, when we have this web
application conversation, alright, when you want to get something, then you use HTTP’s get command. And when you want to post a
request, you use post command. So, that’s entire thing, get, post, delete, and update,
if you’ve heard about them. They’re called CRUD operations, right? Create. What was R? That was CRUD only. Update and delete, right? Drawback is that every
communication with RC Server is time consuming and hence RC is slow. Now I believe that you
understand this point, because I’ve already told you how server, first, running the server, then sending the instructions to Core, and then Core was sending the
instructions to your browser. So, it was a long process. I don’t know if, I’m not sure if you’ve
got that diagram here. Otherwise, I’ll quickly create
that diagram and explain. I know we don’t have. So, what I’m going to do,
just give me a second. Let me see if I have that in my document, that diagram. I’ll explain that to you, okay? That’s for WebDriver. Yes, that’s here. If you look here, alright. Now let’s say these are your
Selenium commands, okay? It’s a script in this diagram, because this is again taken from web. I haven’t created this one. Consider it as your Eclipse side. The end, you’ve got a whole script here. You have to run the server first, so that it injects the HTTP proxy. Now, the server coming up
will also take a few seconds. Then what you have to do is browser with Selenium Core injected. So, you’ve got a browser. And obviously, any application
is running over a web server. Now, when you send the instructions, server will get started. Your instruction will go to Selenium Core who is sitting inside your browser. Selenium Core will then
send the instruction to your browser. So, there was no direct
communication between your script and the browser or the web application. Two more things that are in between. Here’s RC Server and your Selenium Core. This thing was making it slow. Alright, drawback is
that every communication with RC Server is time
consuming and hence RC is slow. Now that I have explained
the diagram also, I believe you’ve got this point. So, Selenium version 3 onwards, RC has been deprecated and
moved to a legacy package. Let’s go to the next slide. My favorite tool and most
widely used, WebDriver. WebDriver is a programming interface to create and execute test cases. It’s again the same thing. The base is again the same. This is also an API. It’s a programming interface, and we can create and
execute test cases here. Test cases are created and
executed using elements, object locators, WebDriver methods. So, let me explain at this point how do you use object locators
to find these elements, why is it important to
find these elements, and what are these WebDriver methods. Okay, I’m not gonna cover the coding part, because we’ll see that when
we run the use case, okay? So, let’s say I’m opening up Amazon. Now, let’s say I want to
do a search on this page. How will I do the search? What will be the manual steps? So, the manual steps would
be to choose a category. First, click on this
dropdown, choose a category. So, let’s say I want to
click on electronics, and then I just wanna type in iPhone 7. I’m saying I want iPhone 7. And then after giving this
text inside this text box, I want to click on it. Okay. Now I’ve got these options,
the colors and stuff, Jet Black 128 GB, and then Black 32GB. Let’s say I wanna click on Apple. iPhone 7 Black 32GB. So, another link opens up. Now, if I have to automate
the steps that I’ve just done, that I’ve just performed,
how will I do that? These are the various
elements, like I explained, on this page. Everything that you can see on this page, whether it is a text, or
an image, or a dropdown, or a text box, or a
button, or these links, or these images, okay, everything that is visibile
on this page is its element. You can also call them objects. If I have to automate
any action, any process, I first need to find out this dropdown. Let’s say I want to entire
this process, which I just did. I first need to find out how this dropdown can be taken care of. How will I do that? I need some technique for it, right? until and unless I have this element, I cannot click on it. Now, once I get this
element and click on it, now I need to get this list. Then only I’ll be able
to choose a category. When I choose a category,
I’ll be clicking on it. Right? Let’s say I’ve clicked on books. Now, this is a text field. I need to get inside this text field and I need to type something here. Let’s say how life works. I first will found this text field, then I will send this text
inside this text field. Then I will find this
button, search button, and then I’ll click on it. The point here is if you want to automate any action or any process, you first need to find these elements. Then only you can perform action on them. How do you find these elements? So, for that, in Selenium, we’ve got different
element locator techniques. Okay, I’ll just write this down here. To find web page elements, you need to use some locator techniques. Okay, so I’m not saying that you have to use these locator
techniques in Selenium. The other tools must also
be using some technique to find these elements. Then only they can automate them. In Selenium, we’ve got eight
element locator techniques, which means in eight ways I
can identify these elements and then I can act upon them. Let’s get back to the slideshow now. The same test cases are created
and executed using elements. So now you know what elements are. Object locators. Without locators, you
can’t find these elements. WebDriver methods. Now, whatever action you will perform, these are those methods. WebDriver driver methods
will let you perform action on the elements that you will find using one of the object locator technique. This is what this line means. Selenium WebDriver has
programming interface, not IDE. WebDriver is an API, and you can have this in a form of jar. You can use its classes. You can use its interfaces. You can use the functions
written inside this interface. It is not an IDE. IDE means it doesn’t have any integrated development environment of itself. That’s the reason we choose
Eclipse, or NetBeans, or any other development
environment to write our scripts. Selenium IDE supports only IDE, doesn’t have programming interface. So, when we were going
through IDE, we just saw that. We don’t have any programming interface, as in I cannot call in any
interface or any function or any class within
that, but yes, of course, I’ve got a development environment there. Fast as it interacts
with browser directly. Now, with web driver,
we got rid of RC Server. We got rid of your Core as well. We do not need any core now. So, my script is going to interact directly with the browser. That’s the reason it
is much faster than RC. Let’s go to the next slide. Selenium suite of tools. Again, we’ve got this WebDriver. Each browser has its own driver on which the application runs. Selenium WebDriver makes
direct calls to the browser. Initially, this point is
difficult to understand, because it is using terms. If you’ve just heard of Selenium or if you’ve just decided
to work with Selenium, you might not have heard about them. Each browser has its own driver. What does this mean? On which the application runs. Selenium WebDriver makes
direct calls to the browser. Okay, have you ever thought that if I’m writing a script, and in the script, I’m
finding HTML elements using some object locator
technique, let’s say. Okay. Now I found these elements, and I’m performing action on them let’s say I want to click on the dropdown, and I’m doing that inside my script. Now, when I run this script, how will my browser
understand that script? Because, obviously that
actions are going where? They’re going to the browser. How will my browser
understand that script? Have you ever thought of it? Because I said Selenium supports, we’ve already seen that it
supports all the major browsers. For every browser, in
Selenium, we’ve got a driver. You can call this driver,
again, as a server, okay? Now, whenever we run a test case, we first need to choose
that on which browser, I want to run my test case. So, that’ll be the first
thing to do decide. If I’m going to use WebDriver, on which browser am I
going to run the test case? Let’s say my choice is Chrome. So, I need to tell my script that you’re supposed to
open up Chrome first. Now, once Chrome opens up, how is it going to take the instructions? It is going to take the instructions only when I have this driver running. So, you understand it as a server. Now, it’s not a small thing, and we don’t want to get
into the intricacies. See, even if there’s a sever running, there has to be some protocol
written inside your API and written inside this driver. That’s how they’ll
interact with each other, and that’s how your browser will understand the instructions. So, we don’t want to
learn about that protocol, what protocol it follows. No. What we want to know is
that there’s a server which I need to run before
sending the instructions. So, for that, I need to
have this driver, okay? So I’ll talk about the
major ones for windows. So, let’s say I’m working on Chrome. So, for Chrome, I have
gotten executable files. See, what are servers? They’re standalone files. And what are standalone files? Executable files. So, for this, I have
got a chromedriver.exe. That’s an executable file
which you can download. Okay. For Firefox. Prior to version three of Selenium, we were not supposed to
download any driver for Firefox, because that came in
built with Selenium jars. So, that was not required. But Selenium 3 onwards,
we need this driver called geckodriver.exe. We need to download it if we want to run our test cases on Firefox, similarly for Internet Explorer… Okay, we’ve got these drivers. It is called iedriver, iedriver.exe. And if you want to see all these drivers, I’ll tell you where you can find them. So, if you want to work
with the Selenium scripts, along with the Selenium jars, you also want these drivers. So, what you can do is go to Chrome, open up seleniumhq.org. Okay. Seleniumhq.org. Again, go to the download tab. Go here, and we might just
have to scroll down to find it. Okay, we have it here. If you see here, these
are the browsers, okay, and the drivers. Can you see? We’ve got Mozilla GeckoDriver. We’ve got Google Chrome Driver We’ve got GhostDriver. We’ve got Edge Driver. See, we’ve got Edge Driver as well. HtmlUnit, this is the one
which I was talking about. It’s a headless driver. SafariDriver. So, you’ve got all the
major browser drivers here. What you have to do is
have to download them. You can download them on your own. I’ll tell one how to download. So, let’s say I want to
download Chrome Driver. So, I’ll click here on 2.27. It’ll take me to Google API site. Now, that’s the latest one, 2.27. For Windows, we’re
using Windows 32 and 64. You can download this one. For Windows 32 and 64. People ask me, this is 32. No, it works for 64 as well. Okay, those who are using
Mac will download this one. Those who are using Linux,
for 32, it is this one. For Linux 64, it’s this one. Okay, download this one. So, let’s say you want
to download for Windows, download this one. Now, when you download
it, it looks like this. Okay, this one. Now, if you see this folder, I have unzipped it, and you also have to do the same. You need to unzip these folders. Unzip them and look here, what is there. Chromdriver.exe, so that’s your driver. That’s your server. That’s your executable. You need it if you want
to run your test cases on your Chrome driver, or if you want to run your
test cases on Chrome browser. Similarly, download Gecko. If you can see, I’ve got this Gecko, okay. And this is geckodriver.exe. Follow the same thing, click on the link, download the latest version. Alright? Let’s go back to the slideshow now. Alright. Each browser has its own driver on which the application runs. Selenium WebDriver makes
direct calls to the browser. So now you know because we don’t
need any server in between, as in your RC server kind of thing, or Selenium Core kind of thing. Types of WebDrivers, Chrome, Safari, IE, Firefox, HtmlUnit, and
there are more as well. You’ve got Edge. You’ve got Opera, so all the major browser drivers. Okay, we’re still continuing WebDriver. These are the features which
we’ve already gone through. I’ll just quick read them. Programming language. So, we’ve got support for all the major programming languages. Browsers. Not just these, but
all the major browsers. Operating system. Windows, all the versions, Macs, Linux, Android, Ubuntu, all major operating systems. Overcomes limitations of Selenium 1, like file upload, download,
pop-ups, and dialog barriers. This was a limitation
in RC, like file upload. Now, we can do file upload using a command called
sendKeys in Selenium, which we’ll see later. The beauty of WebDriver is we can use third party tools
along with Selenium WebDriver. Okay. Now, for upload, I said I can use a Selenium command called sendKeys, and I can also use third
party tools like Auto IT or AutoIt, which I’ll
be demonstrating later when we’ll come to upload portion. Download, we can download stuff. Pop-ups and dialog barriers. Now, you might have seen that when you work with
different web application, there’s a tendency, not tendency actually. You might just encounter a pop-up. Now that pop-up can be of any type. It could be an alert pop-up. It could be a prompt or
it could be anything. Earlier, we were not able to handle them, but in WebDriver, we can
handle all these alerts. Selenium WebDriver drawbacks, the only drawback that I
find in Selenium WebDriver is its reporting generation thing. WebDriver cannot create
any report on its own. We either need to automate
the process using framework for which we need to
be efficient with Java. Okay. And the next thing is
that we can use TestNG along with Selenium. But WebDriver on its own
cannot create a report. And the next point is no
centralized maintenance of objects and elements. So, we don’t have any repository asset wherein we’ve got these
maintenance of objects and elements of different webpages. I hope you now understand
what elements and objects are. Okay. Alright. Let’s come to Grid. Okay, so we have to now start with Grid, so we’ll see what Grid is all about. We’ll quickly go through the slide first, and then I’ll explain. Probably, I’ll create a
diagram for you if required. Selenium Grid is used to
run multiple test scripts, multiple, at the same
time on multiple machine. Now, if you say at the same time, that means you’re doing parallel testing. Parallel execution is achieved with the help of Hub-Node architecture. I’ll come to that. Hub can control different test scripts on various browsers, operating systems, and programming language
and various nodes. Hub and nodes started using jar files. Supports RC test, as
well as WebDriver test. Now, Grid is another feature in Selenium, which is beautiful. Okay. So, I’m gonna explain this to you. Let’s say I’ll open up my paint. I’ll try my best to create
a diagram that looks good. Okay. Alright, I’m basically
creating the film nodes, and that’s my master system, okay. That’s my master system, and I’ll use this line. Okay. This is my master system. I’m gonna call it Master or Parent. Okay. And this is Child 1. This is Child 2, This is Child 3, and this is Child 4. I’m not saying that this is, I mean these many systems
you’ll have all the time, but the architecture of
a Grid looks like this. You’ve got a parent so-called hub here, and these child systems
are also called nodes. So, you can say that this is node one, and this is node two, this is node three, and this is node four. What is the use of Grid? You can run different test cases at the same time on different systems. When I say different systems, it means all these systems are different, having different operating system, and maybe different browsers. Okay. Now, let’s say that’s a Windows system. This is Windows 10, okay? This is Win XP. For example, or let’s say that’s a Mac, and let’s say this one is Ubuntu. Okay, and that one is your Linux. So, we’ve got different operating
systems on these systems. That’s what I want to achieve. How can I achieve? I cannot achieve this using WebDriver, but I can achieve this using Grid. I’ll have multiple systems
in the environment. I will have one master system, which will control these
child systems called nodes, and these nodes have
different operating systems and maybe different browsers. Let’s say Windows 10. This has your Chrome for example, okay, and your Mac. This has Safari. Okay. And we’ve got Ubuntu who has Firefox. And let’s say we’ve got Linux again with Chrome per se. Alright. Now, I’m running test cases
on different environments. The very first question that arises is why do I need this kind of system? So, that’s the beauty of Selenium. Let’s say you have created
a very new web application. Okay. Now, you don’t know whether
your client is using Windows 7, or 8, or 10, or XP. Or, does it have a Mac PC? Or, maybe he’s using Ubuntu
as the operating system, and you’ll never know that he’s trying to run
your application on Linux. What do you want? You want that your application
should run absolutely fine, no matter what kind of
system the client is using. So, if you want to test that, and you want to speed it up, Grid is the choice. You can create a Grid and run
your test cases parallelly on different environments. Okay. So, it’s all about having hub and nodes. Now, how do you send
instructions from hub to nodes? So, for that, we need to
do a few configurations. So, I’ll have to start these nodes, because they are different systems. I’ll have to start this hub also. So, the very first thing
you do is you start the hub. So, we’ve got a few commands to do that. And what helps us in running this hub? So, if you’ve got a jar called Selenium Server Standalone, okay. We’ll talk about that. We’ll be downloading it also. So, we have this jar. This is the jar which will help us run hub and also start nodes. And after running a few commands, we’ll configure them together, so that your hub nodes, which all nodes have
been registered to it. And also, your nodes will also
know that which is the hub, so that I can take instructions from it. So, that’s how this
entire system is created. Now, I’ll explain the slide, okay? Okay. The Grid is used to run
multiple test scripts at the same time on multiple machines. I hope you now understand this line. Parallel execution is achieved with the help of hub node architecture. So, I’ve created the architecture. That’s how you run test cases parallelly. Hub can control different test
scripts on various browsers, operating systems, and
programming languages, and various nodes. Okay, I missed that point. Now, it is not important whether you’re using Java here on this system, or some other language here,
some other language here, some other language here. Okay. You can use one language
to write your script, because when you create the structure, you will be sending all the instructions only through your hub. The execution will happen on your nodes, but all the instruction part
will happen here on hub. Your hub will be directing your nodes. Let’s say on hub I’m saying that I want to run my
test cases on Safari. Okay. So, obviously, I’ll have
to do that configuration in my script. Okay, I’ll have to write, but
you have to run the test cases on the node which has Safar on it, and Mac has the operating system, and it can use an language. We’re least bothered about it, because Selenium supports
all the major languages. So, that’s how it happens. Okay? Selenium Hub can control
different test scripts on various browsers, operating
system, programming language, and various nodes. Hub and nodes are started using jar files. So, how do you run this entire system? You first start hub, and then the nodes. So, both of them are
started using a jar file called Selenium Server Standalone. It supports RC test as
well as WebDriver test, so you can run both. Okay. I haven’t worked with RC and Grid, so cannot comment much on it. But yes, of course, you can
use your WebDriver commands. Hands-on: handling elements
on Edureka’s home page. Now, see, when we’ll be working with Grid, that time I’ll tell you how
you can use command prompt to run your hubs and
nodes, how to start them. So, we’ll be talking about
every suite in detail. Okay, not IDE and RC actually, okay, because I’ve already covered IDE. We might just take a class on IDE. But RC, of course not. And then WebDriver, we’ll
have all the detail thing, all the commands, all kind of commands, so whether they are simple commands, whether they are your WebDriver commands, whether they are classes, okay, whether there are
other interfaces in Selenium. So, we’ll be looking at those functions and APIs and classes in the later classes. Grid is done, but we’ll have another class wherein we’ll be actually creating a Grid. We’ll create a Grid
and run the test cases, so that you know how this Grid behaves. Okay. Now, in this class,
what I’m going to do is, how I’m going to end this class is I’ll be writing a small script. Now, before I write that script, I’ll tell you how to create an environment so that you can start
writing your Selenium script. So, we’ll be downloading a few things. Okay. We’ll follow that up. Once that is done, I’ll write a small script,
taking Edureka as my use case. And I’ll maybe perform a few actions just to give you a brief what
you can achieve by automation or what you can achieve using Selenium. That’ll not be the entire thing, okay. It’ll be a small example, but I’ll give you a picture that what wonders you
can do using automation or using Selenium as you automation tool. So, gets going, let’s get going now. We’ll quickly download
the important things. So, what I’m going to do is I’m gonna share these URLs with you. So, I’ve got these downloads. I’ll go to my desktop, and
my folder, and Installation. So, what I’ve done, I’ve saved these links here in this file. So, first of all, you’re
supposed to download Java. Why we chose Java? Because that’s the most
widely used language, and I’m sure that Java has
a huge career in its own. It’s not gonna change for years. It hasn’t changed and
it’s not going to change. Change as in, I mean Java
will not get deprecated ever I believe. Okay, so let’s take this URL, and when you’ll be watching this video, you can simply take a look at the URL. Okay, maybe can take a screenshot, you can just write down on a notepad, which URL I’ve typed in here. Basically, I’ve gone to oracle.com, and then I’ve chosen Java and Downloads. Okay, I went to Downloads and then Java. I’ve saved this URL directly. Now, what you have to do is… This is your Java, okay. If you scroll down or
maybe just click here, so that we get inside
the development kit link. Now you can see that we’ve got Java for Linux, Solaris, Windows, and Mac. I’m working on a Windows system. If you’re working on a Mac system, you’re supposed to download
this one, .dmg file. If you’re working with
Windows 64-bit system, you’re supposed to
download this executable. If you’re working with
Windows 32-bit system, then you’re supposed to download i586.exe. Okay. And yes, when it comes to the versions, I want everyone to use
the latest versions. If you’re using Selenium
3, it’s clearly written, Selenium 3 works well with Java 8. If it doesn’t give good results with 7, now you’ll have to figure
out what was the reason of getting an exception or some error. Alright. My advice, please use Java 8, Selenium 3, and all the latest versions. When it comes to IDE, as in your Eclipse, I’ll just tell you about it, which one to download and
which one not to download. Okay, so just click on here. Alright, this gets downloaded. You will be double clicking on it. I’m not gonna do that, guys, because I already have java on my system. You’ll be double clicking
on this executable file so that it set up Java for you. Now, when you run this, you will see that when you go to C drive, okay, and when you go to Program Files, you will see Java here at this folder. How to verify that your
installation was correct. You need to make sure that you have got jdk and jre folders in place. If you see any of them missing, that means that your
installation was incorrect. It didn’t happen correctly or it didn’t happen well. You will delete the entire thing, download the executable fresh,
and then run it back again. Okay, but just make sure that
if you have both the folder, that means your installation was correct. Okay. That’s how you will download Java. Now, once you download Java, you can download your
Eclipse and Selenium jars. So, I’ll just copy paste this link. Okay. So, that’s again googleapis.com. We can download our
Selenium APIs from here. Control + C. I’ll go back again here. Let’s open another tab. Control + V. Now, see, you’ve got
the 2.xx versions also. Okay, you’ve got 2.xx versions also. And then you’ve got 3.0. Initially, we’ve had beta versions, and then we had full fetch 3.0, and the latest one is 3.2. Oh, we’ve got 3.2 as well. The last time I saw it was 3.1. So, we’ve got 3.2 as well. So my suggestions, whenever
you’re watching this video, take the latest one. So, by the time you watches this video, if 3.3 happens to come
up here, please take 3.3. Okay. So, what you have to do is
you have to click on here, let’s say 3.2. Now, here, I need to go to 3.1 first. Yeah. Don’t take 3.2 for the reason that it’s showing me some other jars, which I’m not sure of using. Okay, don’t take 3.2 because
I’ll just quickly show you. If I click on 3.2, it doesn’t give me Selenium Server Standalone, which is the jar which we’ve used always. This is some .NET jar. So, we don’t have any other jars here, so don’t use 3.2. Go back and use 3.1, alright? So, I’m gonna click on 3.1. And if you see here
you’ve got Selenium Java, Selenium Server, and Selenium Standalone. What you’ll need is
Selenium Server Standalone. That’s the major one. And you need seleniumserver.zip. These two will suffice
all the requirement. This is a jar in itself, and this is a zip file
having number of jars. Keep in mind, whenever
you download a zip folder, please unzip it. Otherwise, you won’t be able to import jars into your workspace. Okay. So, when you download this, unzip it. Fine. Now, when you download this,
it will look like this. So, if I go to D drive, Akanksha, and Selenium new. Okay. So, the last time I downloaded was 3.0.0. It’s a zip and I have unzipped it. Now, you’ve got all the jars in nodeps, and there’s a library folder, and you’re supposed to take all the jars. If you go back, the Selenium
Server Standalone as well. That’s the most important jar. You can’t work without it. So, please download it, okay? So, this is done. The last thing is to get your Eclipse. So, that’s eclipse.org. And what I want you to do is
you can take a screenshot. Okay, just take a screenshot of this. And once you take a screen shot, you will have this download document. Okay. And I’m gonna go to Eclipse. Okay. Now, if you see there IDE &
Tools, that’s what we want. Click on IDE & Tools. Now you see here, this Java
IDE, Java Enterprise Edition, C++ and PHP. We want for Enterprise Edition. We can work with core Java as well, but I want you to download this one for the reason that majorly
the projects are written in an enterprise edition form. Okay. Rarely, core Java is used. So, I want you to click on here. Now, you can see the releases. You can see the releases. You can have anything from Luna to Neon. Don’t use Kepler, Juno, Indigo, Helios. They are older versions. We’ve got neon right now. So, if you have anything between them, that should work fine for you. Otherwise, I cannot assure
if you’ve got any exception or if you get any error
with these packages. I’m not sure. My suggestion, use from Luna to Neon, and it’s best if you take Mars and beyond, Marx, Oxygen, or Neon. Okay, now let’s say you’re taking Oxygen. For example, or you already have Oxygen, or you’re trying to download Neon. So, if you take Neon, click on here, that’s for Enterprise Edition. So, you’ve got 32-bit, 64-bit. Please download the correct one. Don’t do the mistake of
download some other bit version. So, if your system is a
32-bit system, download this. If it is a 64-bit system, download this. For Mac users, this is the one. For Linux users, these are the ones. Okay. Download, follow the instructions. Now, this is again an executable. Let’s say I’m click on 32-bit. Okay. You get a mirror website. Don’t get bothered after
seeing the mirror website. That’s okay. Click on here and download it. Unzip it, and you’ll get the Eclipse. Now, what I want you to do is… What people do, they make a mistake. I’ll just show you. Where have I saved Eclipse? Let me just find out. What I’ve done, I’m not
taking Eclipse in C. I’ve taken Eclipse in D drive, because that’s where I have
all my work-associated things. Okay, so, I think I have in Selenium. Sorry, let’s come back. It’s here in D drive Eclipse. Now, do you all see this executable file? Do you all see this executable file? That’s the exe. I don’t want you to run it all the time you want to work with Eclipse. What you can do is right click on it. Okay, there comes an
option to pin it task bar or pin it to Start Menu. Please select that, so that
you get some icon like this or maybe in the Start Menu. I haven’t pinned it in Start Menu. I have pinned it to task bar. Do that. Don’t run this executable again and again. Okay. Alright. So, that’s about downloading. Now, you’ve got Eclipse we’ve got Java, we’ve got Selenium. So, we are all set to write
the very first script. So, I’m going to start my Eclipse. I already have it in place. My version is Luna, so
that’s not the latest one, but it works fine for me. Okay, it’s already here. Okay, so I’m gonna close this. I’m gonna put this down. Now guys, see, this is the workspace which I was working in. But for these tutorials,
I’ve created a new workspace. When you will download
Eclipse for the first time and open it, it won’t appear like this. That’s the reason I
created a new workspace. Don’t get bothered. I’m gonna switch the workspace,
you don’t have to do that. Alright? You just have to open Eclipse. Don’t worry about doing this. So, I’m gonna browse a new workspace which I’ve created here, which is this, Edureka Tutorials. So, I’m gonna press OK and OK here. So, this is again gonna take some time. They’re switching the workspace for me. We can see workspaces wherein
you’ll create your projects. So, you can have different
workspace for different projects or you can create different
projects in the same workspace. That’s entirely up to you,
how you want to maintain. Okay, now when you will open Eclipse, when you will open Eclipse
for the very first time, it will appear like this. That’s the reason I
created a new workspace, so that you can see exactly the thing that you will face when you
download and start Eclipse. Okay. So, if you get this page,
what do you have to do? You have to click on Work Bench, because that’s where you
will start writing your code. So, click on Work Bench. Now you’ve got a new Work Bench. You don’t need this task list. You don’t need this. So, what I want you to
do is just minimize it. And if you wanna minimize
them or close them, do whatever you want to do. I don’t want them, I’ve closed them. That’s my Package Explorer,
but it’s currently empty. What do I want to do now is I have to start working with my script for which I need a project. Okay. So, the next thing is click on File. We’ve got these options here, New, Open File, Switch Workspace, Restart, Import, Export, blah, blah, blah, and Exit as well. Okay, I want you to click on New. You want to take a
project, a Java project. Click on Java Project. Name it. Let’s say these are Edureka tutorials. That’s how I want to name my project. Okay. I’ll say Edureka Selenium. Okay, now when this project is done, I don’t want SVN. Okay, so, you can just ignore it. If I expand this project, this is the default
folder that gets created. And that’s the Java System Library. How does this come up? Eclipse does it for you. So, whenever you download Eclipse and start working with it, please make sure you have
Java already in place. If you don’t have Java already in place, Selenium won’t get these jars. In fact, Selenium will not start, because what it does is C. What is the default location for Java? It’s C Program Files, right. That’s where it always get download. If your Eclipse is not
able to find that part, it’ll give you error. So make sure you have your Java in place, and it will automatically
bring the library into your workspace. So, we’ve got java System Library so that we can work with Java. Next thing we want is our Selenium jars. So, how do we bring
any jar into a project? Right click Build Part. So that’s the place you
will use to get your jars into your project. Then click Configure Build Part. Here, you already have jre. Go to Libraries. This is Order and Export. You’re supposed to go to Libraries. This is Add Externals JARs. So, now you have to bring
in the external jar. So, click on it. As soon as you do so, you
will get some location, or you can probably give
the location on your own. I’ll go to Akanksha. And in Selenium New, I’ve got my Selenium jars as I told you. So, I’m gonna take Selenium
Server Standalone first and open it up. And then I’ll, again, click
back on Add External JARs, so that I can go to Selenium Server. Take note, yes, I will
again click back, why? Because I have still not taken libraries inside lib folder. I’ll do Control + A, and I’ll click on Open. So, I’ve got all my Selenium jars now. Click OK. So, if you see, apart from JRE, we’ve got Reference Libraries also. Now what people do is they
create different folder called lib. That you can also do. Okay, you can create a different folder. All you have to do is
right click New Folder. You can create a folder,
and then import your jars, or you can directly do so. That’s your choice, okay? So, we’ve got the Reference Libraries. If you expand it, there are
nothing but your Selenium jars if you can see here, right? You’ve got your Selenium
jars, you’ve got your Java. Everything is place. We are all set to write the script. Now, what is my tendency
to write the script. I always do things within a package. So, what I’ve done, have right clicked on this default folder, SRC,
New, and I’ll do Package. Now, why do I need package? Because, see, if you’re
friends with any developer or if you’ve got friends
in development team, just go and browse their code. You will see that everything
is within packages. And when you’ll read the packages, just by reading the name of package, you will get to know that
what does it contain. By having packages, we increased the readability of the code. Okay, it’ll be easier for us to find out any particular file later on. So, when I’m gonna create
this, how will I do? Co.edureka.selenium.webdriver.basic, because today I’m gonna do basic. Edureka.com is the website. So, let’s say you’ve got abc.com, so how will you name your package? Com.abc. Now, your application name is XYZ, okay? So, maybe you can give ABC. And then package also have
components in the picture. So, let’s say you’ve
got different components inside your application. And we’ve created files
within different packages, and every package is
basically telling about different component. So, let’s say you’ve
got an admin component, so you can write admin. And then within admin,
let’s say you have got some CRUD operations, and maybe you’ve got
some administrative task and some of your user task. So, you can create packages accordingly. Since this is a tutorial
in Selenium WebDriver, that’s how I’ve named it,
selenium.webdriver.basic. So that when I do this and
when I just expand this, you’ll understand, okay,
all the basic stuff is within this package. Click Finish. And mind you, package name
should be all in small and your class name should all be in caps. Not all, but should start
with capital letter. Okay, you can go through
these rules and regulations of writing code online. You can find them. Please adhere to them, okay? Now, I want this. I’ve right clicked on my package. I want a Java class. Okay. Let’s create a Java class, and I’m gonna name it as Day1. I’m giving it Day1
because in this tutorial, we’re just going to
learn what we can achieve through Selenium. Alright, this is an
introductory class, basically. And I’m gonna tick main as well. Finish. If required at any point of time, I’ll explain the Java portion. But side by side, I want you, when you’re watching this tutorial, I want you to go through
Java programming concepts. Okay, so, everything, this class, this public static void
mean, they have something. They have some meaning
behind them, alright? And why have I take this main here. Maybe when we’ll come
to WebDriver portion, when we learn WebDriver in detail, it’ll be possible to just
explain these commands. I’ll explain them, okay? Alright, so what I’m going to do is I’m gonna write a piece of code. So, give me some time to write the code. Just keep watching this video. And after writing every function, I’ll explain that function. Okay? Now, this is giving me error because I’m using WebDriver, okay? That’s where all my functions are, because this is Selenium WebDriver. So, the very first thing
I need is my WebDriver. So, I’m creating a variable
driver of that WebDriver. Now, this is giving me error because I have my WebDriver
library in the project, but I haven’t imported
it inside this class. So, you have to click on it to find out what is the reason of this error. So, if you click, this
is Import WebDriver. From where, organization.openqa.selenium. You can do this or you can simply do Control plus Shift plus O. Control + Shift + O. Okay. Let me try if I can write it down, and I’ll erase it then. You’ll have to write Control, okay, plus Shift. Sorry for the bad handwriting. I just can’t use it. And then O. Okay, Control + Shift + O. That will open up the
declaration, alright? Okay. Now that I have WebDriver, let
me start writing my function. So, what I first want to do is I want to invoke my browser. So, public void invokeBrowser. So, that’s my function. Okay, invokeBrowser. And I’m actually going to
instantiate my driver now, because right now it’s still a variable. I haven’t instantiated it as yet. So, inside invokeBrowser, what I’m going to do is I’ll say driver is equal to new. I want to use Chrome, okay. So, I’ll say Chrome driver. See, guys, you don’t need
to learn them by heart, as in whether it starts from capital C or whether this D is capital D. That’s the beauty of using IDE. All you can do is use Control, or you’re using Mac, Command, plus space. Control + space. So, that’s intelligent code completion. You can choose the option
you want form here. So, I want ChromeDriver,
so I’ll take ChromeDriver. That’s done. Now, I told you you
cannot use Chrome driver until unless you have driver in palace. So, how do you use that driver? For that, we need to
write this line of code. Okay. System.setproperty. I am basically about
to set a property here. Now, this property has a key value pair. The key is both of them has strings. They’re string arguments, and we mention string
in double quotes, right? First, mention the
syntax and then fill it. So, my key is WebDriver.chorme.driver. That’s my property name, and that’s how you have to
start using your WebDriver. And the value. The value is where your driver is placed. So, where did I keep my driver? I kept it inside D drive, Akanksha, and Selenium, and here. Right? So, the latest one, I believe, is here, so I’m gonna take this one, take this location, Control + C, Control + V, chromedriver.exe. You need to mention the
filename as well, right? And then in Java, your
backslash is considered as an escape character, so you just can’t have single backslash. You need to place double backslashes. Alright, just place double backslashes. This is the location where your
ChromeDriver.executable is, and semi colon. Okay. Now, that’s done. I’ve instantiated my Chrome driver. I’m all set to use the
functions inside it. Okay, so what do you do now? You use driver as your object reference. So, we’ll talk about that later. Maybe I can cover a bit of Java later in other tutorials, upcoming tutorials. What you have to do is driver. You need to manage a
few browser properties. So, how do you tend to
learn these lines of code. Just keep in mind that
WebDriver is the thing where all my functions are, which is going to control the browser, and manages the function which will let me manage the browser’s properties. Okay, sriver.manage., I want to first of all delete all cookies. I want that my browser
should delete all the cookies of the URL which I’m about to call, okay? Next thing, driver.manage. Again, manage because the
next thing is to manage, again, browser property. I want to maximize my window, because what happens is when
you call your browser driver, when you instantiate your
driver using this line, okay, it opens up your browser
in a minimized form. It doesn’t open it wide. So, you need to either
set the size of the window or you can simply say
window, Control + Space to for intelligent code completion, include window.maximize, and that’s done. Now, the next, this a whole concept, which I’ll not explain now. Maybe later. I’ll give you a brief. I’ll theoretically explain
it, but not in detail. The nice thing I’m going to do is I’m gonna do bait synchronization, which is a very essential
part of automation testing. And we do bait synchronization
not just in Selenium, but in other tools also. Here what I’m going to do
is I’m going to put a few wait statements. Driver.manage.timeouts. Okay, because I’m placing
some timeouts here. Implicitly wait. Now, that’s called an implicit wait, and that’s called element
detection timeout. I’ll explain this later on, but whatever two lines I’m placing here, they mean basically I’m trying to synchronize this piece of
code with the web browser or the web application. Because think it this way, these are just lines of code. It is Java. When I’ll run this file, one line after the other
will get executed, right? And it will happen in a snap, because that’s an execution, it’s a programming language. I have to execute the code, and it can happen within
a few milliseconds. Not even seconds however, using these lines,
you’re controlling your browser, you’re controlling your web application. Now, if I just show you quickly here, let’s say I’m opening jabong.com, okay? Just an example. Now, when this page is coming, can you see there’s still
rolling, and rolling, and rolling. That means that page is still loading. It hasn’t still come up. And even the elements on the page, they’re not coming up in one goal. They’re coming one after the other. So, it’s taking its own time, and then can depend on the server speed and that also depends
on my internet speed. The basic factor, I mean
the important factor is the server speed,
okay, Jabong’s server, and then of course my
internet speed as well. That’s the second great thing. So, since this is taking time, let’s say in my code,
I’m calling jabong.com. And then immediately, I’m trying to click on this search button. However, this has still
not come up on the webpage, because my browser or the web app is taking its own time. What will happen? My code will fail. For that, we need to do
page synchronization. That means I’d like to synchronize my code and my web app or my browser together. I’ll synchronize them, so that
they understand each other, so that my code can wait for that element to come up on the screen. We’ll talk about them later in detail when I come to different kinds of waits or page synchronization, okay? So, I’m gonna give this
time as 30 seconds. And here we need to mention the time unit with Control + space, okay, .seconds. So, you take seconds, that’s done. And the next line is
driver.manage.timeout.pageload. So, we’ve got two kinds of wait, implicit and page load. They’ll be explained later in detail. Let’s say I’m giving page
load also as 30 seconds. And that’s time unit.seconds. Okay. So, these are the lines of
code you will always write, always and always. These are the important
mandatory lines of code. The next thing is I now
want to fetch the URL. How do I do that? Again, driver is the object
reference of WebDriver. So, I already know
WebDriver is an interface, and it has got all the
functions inside it. If I’m controlling actions from Selenium, then there has to be some
function to control that action. Now I want to call my URL. To call the URL, I will
use the function name get. This will get the URL for me, okay? And if you can see here, it
takes string as an argument, which means that I’m supposed to give the URL in a string format. That is double quotes. And guys, please remember that your URL should be a fully-formed URL, not just www.abc.com. It should be a proper URL using http://. I’m gonna work with edureka.co. Okay. So, that’s my URL. I’m gonna use this one. Now, what I’ll do, I’ll run
only this piece of code for now, so that you know what is happening here. So, which I need to create
an object of this class, which is Day1. Okay. Day1 my object is equal to new Day1. I’m instantiating this
class and using myObj. I’m calling this function
which is called invokeBrowser. Okay, control save. And I would also like to surround my code with try/catch. Okay, what did I do? I selected this piece of code by double clicking on
it, then I right click. I’ll just show you. I clicked here, then I double click, so that the entire code within these curly braces gets selected. Right click, Surround With. I just want to surround
my code with try/catch because I want. If any exception, there’s
a tendency to come. It’ll get caught here. Okay, delete. Control save. I have called invoke. How do you run this class? You can use this green button. For this, I’m only calling edureka.co. Let’s see what happens. Okay, just run it. We’ll write the code after this. I mean more code. So, don’t get bothered by these red lines. They’re just warnings, okay? So, did you see it first
open up in a minimized form and then it maximize the window? And then I’m calling edureka.co here. And where are these functions written? Inside my WebDriver. So, when you… As we’ll go along with
different tutorials, believe me, Selenium is
such a beautiful language. You’ll get addicted to it. Believe me. When I’ll work with different
functions in Selenium, you will go back after this tutorial and immediately you’ll
start working with them. They’re so addictive. Okay. Now, that has grayed out, which means my execution has stopped. And since there are no exception, that means my code
execute absolutely fine. Alright. Now, we will add some code here. So, what I’m going to do is
let’s say my use case is this. Let me close all these URLs. We don’t need them. I’m just closing the unnecessary windows. We don’t need them. Okay. Alright. Here, what I’m going to do
is this Edureka’s homepage. I’m already logged in, which is okay. Alright, I’m gonna search. I’m gonna search a course here. Now, if I have to search a course here, I first need to come to this text box. I’m writing Java, so I
need to type Java here. And then when I type Java, I need to click on this search button. So, when I click here, I
will get this Java option. Okay. Now let’s say I want to scroll down. See, this option, weekend, is coming up only after scrolling down. And guys, just fair information, if you’re working with finding elements, you’re Selenium can find elements only on the visible page. If that weekend thing is not visible, I’ll get an error. You’ll get an exception
element not visible. So, what you have to do is you first need to scroll down a bit, okay? And then you can click here, checkbox, I want weekend classes. Then you’ve selected this checkbox. You’ve got these options here. Okay. You’ve got these options. And if you want to login also, you can log in to this form. So, okay. We’ll do this much first. So, let’s write the code. I’ll say public void, because I don’t want
anything to be returned here. So, I’m creating another
function to search a course. So, public void searchCourse. Okay. That’s how I’m gonna name it. Okay, now done. Here, I’ll be writing code which will help me find the elements. Click on that search, scroll down, and then click on the weekend one. Okay, now, in Selenium,
you can find any element using the function called find elements. And if you’ll see here,
where did I create WebDriver? It’s a global thing. I instantiated inside invokeBrowser, but I have created this
variable outside any function, which means it is acting
as a data member, alright? Which means I can use this
driver within any function. It’s not a local variable. So, using this driver, I’m going to call the
function find element. Find element is the
function which we’ll help me find the element, okay? Because until now,
unless you find element, you cannot act upon them. Now, I’ll just remove and
press Control + space again. Okay, if you see here,
the argument type is by. See, find element, function
is taking some argument, and that’s a by kind of argument. By in Selenium is a class, okay. And I told you, I mentioned at
the beginning of this session that we’ve got eight
element locator techniques to find these elements. So, all these locator techniques
are nothing but functions, and those functions are
written within this by class. Okay. So, I’m gonna take this up, and then by.. Now, as soon as you put by., you get all the eight
element locator techniques. We’ll be talking about
them in detail later. I’ll just mention all the
element locator techniques. So, there are eight
locator techniques, okay? First one, id, then name, then classname. You need to learn them by heart. People might ask them in an interview. And then tagname, okay. And then cssSelector. Then linkText. Everything will be
explained later in detail partialLinkText, and then, last, xpath. So, one, two, three, four,
five, six, seven, eight. These are the eight
element locator techniques, which will help you identify elements. And using other WebDriver commands, we can act upon them. So, there are nothing but
functions within by class. If you press Control + space, you can see all these
functions are coming up, classname, cssSelector, id, linkText, name, partialLinkText,
tagName, xpath, right? All these functions. So, I’m going to use some function, but it depends on my choice. How am I going to find that element. For which we need this. We’ll be talking about
these plugins later also. Okay, this is Firebug and it’s a plugin. I have installed it inside my Firefox. So I want to call Edureka. Okay, and I’ll open it up, because it will help me
identify the elements. We need these tools, guys. If you don’t have. Let’s say you’re working on
automation inside your company, and for security reasons,
you got firewalls. And because of firewalls, you’re not able to load these plugins. No worries, just press F12. F12 will open the inbuilt system, okay which again acts exactly
like these plugins. Okay, so I’ll just scroll it down. This is an arrow, which will help me identify
the elements on page. This is called element locator. Click on it, hover on
different elements on the page. Pay attention on the HTML code. See, when I’m hovering
it on different elements, my HTML code is changing. Can you see that? Right? What do I want? I want search for Selenium course. I will click on it. Now, when I clicked on it,
this line got selected, right? That means this code, this HTML code is relevant to this search for a course. Okay? Now, if I have got this line, of those eight element locator techniques, I need to identify that
do I have anything here that can be used to
identify this search box, this text box? As you can see, I’ve got an id here. An id is one of the eight
element locator techniques, but IDs can be dynamic also. It’s not dynamic in this case. And about dynamic
elements, we’ll talk later. If you see just by reading dynamic value, that yes it is relevant to this field. Please go ahead and use it. They’re the most efficient
way of finding an element. Okay. id is equal search input one. I’m going to copy this. If you see, I’m copying it here. Okay. And the id is this. And id or any other
locator technique, okay, it takes a string argument. So, you have to take a string
argument, guys, alright, within double quotes. Alright, so we’ve got
this find element by .id, and then you need to send some text there. For sending the text, we’ve got sendKeys. Okay. And then sendKeys, I need
to now give my search text. So, my search text is Java. sendKeys again is a command WebDriver. We’ll be taking care of all
these command later in detail. This is just an introductory video, okay? So, I have written the first line. The next library is to
click on the search button. So, you need to identify
the search button, okay. Identify it. I’m not getting it. I need to find it. That’s written something Java. I guess it doesn’t get enabled unless I write something. So, that’s okay, that’s absolutely fine. Now, I’ll click on it. So, let me identify it now. Okay. So, that’s search button. If you see here, it again has
an id, search button bottom. So, I’m gonna take that up, Control + C. Okay. And I’ll save driver.findElement. I’ll do that quickly now. Okay. By.id, again, that’s an id. And id is Control + V. And then I have to click on it. I have to click on this element, so the function name is click. Now, I’ve clicked on it, which will help me searching. So, I’m gonna execute
this batch of code first, so that we are sure that
this piece is working fine. Now, I have already called invokeBrowser, but I haven’t called searchCourse. So, what I’m going to do is I’m gonna call searchCourse from invokeBrowser itself. Because after invoke,
searchCourse will happen. So, I’m gonna do that from here. I’m calling this function,
okay, Control + C. Let’s now run this class. Okay, maximize. Edureka coming up, okay. Type in Java, and then
click on the search button. I think I’ve got some exception. Maybe that’s the reason
it’s not happening. So, that is saying Selenium
WebDriver element is… So, I’ve got this
WebDriver exception, okay, here at line number 33, when
I’m trying to click on this. The possible reason is
because if you can see that it was getting enabled only after I got those options. So, maybe I’m gonna try
a hack here, alright? Because I haven’t covered explicit wait, so I’m gonna do a hack here. What I’m gonna do is I’m
gonna insert some sleep. But before that, I just wanna make sure whether this element is
going to work for me or not. So, that’s the thing search button bottom, that’s correct. Now, what I’m going to do
is I’m gonna do a small hack which is I’m gonna insert some sleep so that this button gets enabled. I’m not placing explicit wait code because you won’t understand
it at this point in time. So, Thread.sleep is a concept in Java that you can make your code
to sleep for a few seconds. Now, that value is in milliseconds. That’s why 2,000 which means two second. I’ll just make it three seconds. And whenever you use threading, there’s a tendency that
interrupted exception might yet occur. So, that’s exception handling in Java. So, what I need to do
is I need to surround this piece of code with try/catch. Who was doing this? My compiler is warning me that you haven’t got
interrupted exceptions. Compiler did that for me. Control save. I’ll close this window,
and I’ll try to run this piece of code again. I should type Java. I should wait for three seconds so that this button gets enabled. Okay, and then click on it. So, let’s see if it works or not. Yes, it is working. So, the wait has worked. Okay, so I need to scroll down. So, my next step is I’d
like to scroll down. Now, scroll down, again,
has a lot of things into it. But what I’m goin to do is I’m gonna write an easier piece of code
here, not in detail. Okay. So, what do I want in this search course. We’ve got the search course, and I will write a small
piece of code to scroll down, so which we need JavaScript. Okay, we’ve got a question
from the current audience. What is the difference
between implicit wait and thread.sleep? See, guys, this is a huge
concept, page synchronization, which will be explained later. But for now just understand
when I put thread.sleep, okay, and I find giving a three-second sleep, it means my code is going
to sleep for three seconds. It has to sleep for three seconds now. But when it comes to page synchronization, we haven’t covered
synchronization in detail, but if I’m placing 30 seconds here, it means that I’m allowing
maximum 30 seconds for any element to come up inside the DOM of this page to get loaded, but it doesn’t mean that
it’ll take 30 seconds. It might take zero seconds. The default value is zero second. That’s a whole concept. By writing this line, what happens is, you know your DOM, data object model. You can just go through
the concept on W3Schools. WebDriver will keep pulling DOM until it finds the element inside the DOM. For maximum, 30 seconds. Now, that element might
occur in zero seconds, it might occur in two
seconds and five seconds. Let’s say it comes up in five second, so after five second, my control
will go to the next line. Because these waits, once written, they’re applicable to every line of code inside the application, which
is working on some element. They have to be written just once. They’ll be applicable to the entire code, until and unless your
driver instance is dead. Okay. So, that’s a hard thing,
your thread.sleep, because it means if you’re
giving a 30-second sleep, it’ll sleep for 30 second. No matter your element comes before that. But with implicit and
explicit waits, okay, we’ll talk about that later, if I’m mentioning 30 second,
that’s the maximum time. Minimum time is zero second. And once my element is found, my execution will go to the next line. But in sleep, my execution
will not go to the next line until that sleep time is over. Alright. Okay. So, left click, and now
I want to scroll down. So, what I’m going to do is I’m gonna quickly clear
a JavaScript executor. No worries, if you don’t understand, this is a class, okay,
JavaScript executor in Selenium which lets us execute a few
scripts, JavaScript executor. Sorry, interface, not class. So, I’m gonna create this one, and I’m going to instantiate it here. Okay. So, let’s say I’m saying
jse is equal to JavaScript. That’s called casting
if you don’t understand JavaScript executor. Okay, I’m casting my driver to executor, JavaScript executor. So, that’s done. Now, what I have to do
is I have to scroll down. How do I scroll down? So, there’s a function
called executeScript which will help me execute some script. So here, I need to scroll down. So, what I’m going to do
is within double quotes, that should be string, I will just scroll. Now, see, guys, I’m taking a random value on the basis of my experience. Don’t worry, when I’ll come to WebDriver, and we’ll be talking
about different functions in Selenium WebDriver in detail, I’ll tell you about this. What I’m going to take is, let’s say zero and thousands. So, that’s gonna scroll vertically down. Okay. And I think I should
get within this frame, the element I want. Now, once I scroll down, what is the next step? To click on weekend. So, let’s expend this
element weekend Java. I’ll click on search. And we’ll just scroll down. I think it should come within this frame, and then I’m gonna inspect this checkbox which is important, okay. So, that’s weekend. And if you see here, that’s
the element, to inspect. Now, I need to identify which element locator technique to use. So, I’m gonna use xpath because there’s no other option here. Don’t get worried, we’ll talk
about xpaths also in detail. I’m gonna make you expert in that. So, I’ll take label, and
then I’m gonna take weekend. And I’ll show you to find that out. This is file path. I’m saying label. I’m creating relative xpath, okay. And then I’m seeing contains. I’m using xpath function. Text, comma, and the text was weekend. So, that’s how I’m gonna find it out. Let’s verify if it’s working. So, I’ve got this if you can see, right? Label, we check for, and weekend, right? So, this is absolutely fine. I’m gonna use it as my xpath. And here, I’m gonna create xpath. Driver.findelement by .xpath. Okay. And my xpath is this, Control + V, which I already tested using my plugin. So, that was Firepath, guys. Just in case you missed
it, it was Firepath. So, there are two plugins,
Firebug and Firepath. We’ll talk about all the plugins later in the next tutorial,
the WebDriver tutorial. Okay, download both of
them, install both of them. And then what do I need to do. I need to click on the checkbox for which the function is. Again, click, Control + C. And when I click on it, I’ll
get the weekend batches. So, let’s execute this script now. I’ll close this window. And for today’s class,
we’ll keep it til here. Next time, when we’ll come, we will see how we can use login form,
search forms, dropdowns. I mean there’s so many
things that you can do with your mouse and your keyboard manually on web applications. Search for Java. Okay. And then let’s just scroll down. And then did you observe that? It scrolled down. And then it should click on weekend. Is it still happening? Did it click on weekend? Have I got only weekend matches? No, I don’t think so. Start over, and we don’t
even have any exception. Search course, it comes here. Driver.findElement weekend. Label contains text is equal to text. I don’t think so this line happened, otherwise I would have got
only the weekend batches. There are eight batches. Let me execute the script again, and I’ll quickly verify with the URL. No, URL will remain the same. One, two, three, four,
five, six, seven, eight. There are eight batches here. Let’s look at the code again. What did I miss? Let me find out. So here, I’m searching for the
course, thread.sleep click. Then I’m scrolling down. And once I have scrolled down, I’m trying to find the element, driver.findElement by .xpath. I’ve got this, and then I want to click on it, that’s it. Let’s verify. If I click here, yes, it should work. Control save. Let’s execute the script again. Okay. Okay, scroll. Oh, that’s the reason. So, what we’re doing is
we’re scrolling too much, due to which it is not
able to find the element. Okay. So, what I’m going to do
is I’m gonna make it 800. I’m scrolling a lot here. Control save, and let’s try this now. I’ll just quickly close. 800 will work for us I guess. So, we’ll talk about scroll, how to use the 0 800 or
maybe the element location. We can also use the element location, the point where element is located, and we can scroll down til that point. We can do that also, but we’ll learn about that
in upcoming tutorials. Yeah, now it worked, right? So, it clicked in here, and we’ve got the weekend batches. So, that’s the beauty of Selenium. We can use anything we want. All the functions are
there in the WebDriver. When you’re working with it, see, obviously, if you’re
watching this tutorial, that means you’ve decided
to work on Selenium and you’re working on
it for the first time if you’re watching this
video, introductory video. Please, my advice, please be patient. Okay, if you get exceptions,
if you get errors, there must be something or the other which you haven’t written
correctly in the code. Exceptions don’t come on their own. There must be something
wrong with the code. If you’re patient enough to just go through the stack trace, through the error, or the
exception that has come up, believe me, you’ll get rid of it. You’ll get the answer just
by looking at the exception. Alright. So, that’s it for my
end in today’s tutorial. In the next tutorial, okay, if the tutorial is on WebDriver, we’ll be learning about all
the WebDriver functions. So, if I talk about WebDriver, you’ve got dropdowns, you’ve
got switching to windows, you’ve got switching to alerts,
you’ve got framing concept. And even before that, we need to know and have to find elements. So, when I’ll be telling
you about finding elements, I’ll be talking about all the eight element locator techniques. And then in the xpath, I’ll tell you how you can become
an expert in writing xpath. And no matter what, if
you’re stuck anywhere, I’ll be telling you about
a few xpath functions which will make your life so easy that even if you encounter
any dynamic element, okay, and nobody is able to work on it, you will be able to work with it. And another functions like, I’ve already covered
switching, then screenshots, then we’ll be covering
keyboard, mouse events. Then we’ll be working
on validation commands, checkboxes, radio buttons, et cetera. There’s so many things to web driver. We can’t complete it in one tutorial, so we’ll have a couple
of tutorials for it. I want you to stay tuned, alright. I hope you enjoyed this tutorial. We’ll be coming up with the
next tutorial very soon. Thank you very much. Alright, guys. So, that’s it from my end. What I’m going to do is… Alright, so I’m gonna quickly
open up the presentation, and let’s make sure we
haven’t missed any slide here. Okay. So, handling elements and taking care of Edureka’s
homepage, we’ve done that. Let’s go to the next slide now. Okay, course details and customer reviews. Guys, Edureka has been
getting very good reviews from all over the world. If you just read out the name, okay, we’ve got Tom Tully here who says, “I wanted to learn Selenium WebDriver “in a live, real course, not self paced, “so there would be
pressure on me to finish. “Edureka accomplished this at a price “far lower than in-person class. “And as far as I know, they
are only internet class “that has live lectures on this subject. “Teacher was very knowledgeable. “I learned basic uses of Selenium. “No problem with me being
in US and teacher in India. “They have US number.” So, we’ve got a toll-free number also, and we’ve got 24×7 support. And there are just these four reviews. Believe me, there are so many reviews we’ve been getting form
all parts of the world. Okay. Teachers here, the instructors here, not just in Selenium, but
for other courses also, they have got their expertise
in the relevant subject. They’ve been working on
that subject, on that field in corporate sector, and that’s how we choose
those instructors here. So, if you want to find
out more about Edureka, I’d like you to go to edureka.co. If you want to search about any course. You can search about the course. I’ll quickly show you the page. So, hat’s edureka.co. And through the example
which I just covered, if you go to edueraka.co, you can search for any course here. Alright, these are our trending courses and popular courses. Okay, we’ve got instructions, we’ve got 24×7 support, we’ve got flexible schedule, and of course live classes. What is the benefit of live classes? You can ask your questions then and there. So, there are more reviews here. You can find them out, alright, not just about Selenium,
but other classes as well. Okay, I’ll just quickly say thank you, and thank you very much for staying intact for these three long hours. I hope you enjoyed today’s class. Till we come back for
the next class, enjoy. Bye bye. I hope you enjoyed listening to this video. Please be kind enough to like it. And you can comment any of
your doubts and queries, and we will reply to them at the earliest. Do look out for more
videos in our playlist and subscribe to our Edureka
channel to learn more. Happy learning.

100 thoughts on “Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Testing Tutorial | Edureka

  1. Got a question on the topic? Please share it in the comment section below and our experts will answer it for you. For Selenium Training and Certification Curriculum, Visit our Website: http://bit.ly/2zoLfPY Use code "YOUTUBE20" to get Flat 20% off on this training.

  2. Thanks for your share. It's really helpful for selenium beginners. appropriated.
    BTW, I love your tone. it's so nice.

  3. Best video i have watched for selenium up till now.Easy to understand and grasp it.Thanks a lot and it really helped me a lot to understand basics of selenium

  4. I have watched most of your other session on this topic(Hybrid framework) but they have already made it and in session they just explained it.. I guess its good for who are already in this line. For me i want to learn it like i have learnt this by watching this session by Akansha. Thanks..

  5. Hi People. I am looking for someone who can help me solving my issue while using Selenium. Here is the link to the problem. https://sqa.stackexchange.com/questions/33946/unable-to-switch-to-frame-which-is-inside-an-iframe

  6. Thanks for this tutorial. I have just started learning selenium. I found FirePath is not working and i heard there is a better xpath tool ChroPath, could you please make tutorial for ChroPath tool. Thank you.

  7. Fantastic. You are very skilled as an instructor. Your instructions are extremely easy to follow and you show every single step. You even include the steps for beginners. Very well done. Thank you!

  8. The only thing I could ask for is slightly better sound quality. It just seemed a little too compressed.

  9. This video is really helpful ..thnx 🙂 …one thing want to say about selenium IDE…it's new version is working on Google Chrome too.

  10. ava.lang.LayerInstantiationException: Package jdk.internal.jimage in both module java.base and module jrt.fs
    how to resolve this error?

  11. Hi Edureka currently i am doing job in IBM but totally i am doing non sense work it is not at all useful to my carreer so i thought that i want to learn Selenium and i selected Edureka tutorial if i learn Selenium now can i get any opportunities i have 1.6 years of experience only is it ok to continue with Selenium or not please guide me in this scenario….Pleaseeee

  12. @edureka I am interested in automation testing using selenium.There are many videos uploaded regarding automation testing.Is it enough to watch those videos only or I should go under training from edureka??

  13. Best selenium tutorial. Well explained. I am new to Selenium and was able to catch up the topic. Thanks Akanksha!

  14. Hi, This video explained selenium beautifully. I even started downloading selenium components and started working.
    while writing script I am getting error in this line itself, import org.openqa.selenium.WebDriver;
    Please explain why I am getting this error.
    Thank you in advance.

  15. Not able to find any command in selenium IDE . I open the Amazon page but IDE is not showing anything.
    Please help me out

  16. Just got my hands on Selenium from yesterday as a self-learning being a developer for years. Though I will use Python but this video definitely helped me to understand the basic of Selenium. Thank you for making this video.

  17. Explanation is really nice. But in Selenium IDE ver 3.3.1, there is no menu bar at the top like: File, Edit, Actions etc. can you help me out with this? I am not able to export the testcase in any programming language. Please help.

  18. I have searching and planning to Learn about selenium and automation testing since so long and move across alot of different vdos on YouTube and udemy but after few mins i start getting bore and everything going over my head and ultimately I closed the vdo. But this is the first time I have seen whole vdo and gain alot of knowledge and strive to learn more. Now it seems easy for me to learn selenium whc I have bee trying to do since 2 yrs. Very well defined and clear voice. Very nice way of teaching. Lovely. Thank you so much madam. U r so good in teaching.

  19. Wonderful presentation..!! I am from a non IT background who is all set to start a new chapter in QA.. a person like me can understand it so well.. kudos.. you voice is just awesome..!! Keep it up..

  20. you mentioned implicit wait in the start of the code. That will be applicable to the whole code. They why didn't it wait for the search button. Why did we add sleep for 3 seconds?

  21. What a great tutorial. Exteamely easy to learn because of wonderful explinations. Your accent is so good, crystal clear to understand. Thanks

  22. Hello Akansha !!!
    Awesome Tutorial for begineers…I had checked courses on Edureka but they told me that I won't able to attend your classes.
    Please help me out in this..I want to attend your sessions only…
    Also I have been facing "java.net.SocketTimeoutException" while calling search method..please help me out in this

  23. I've never seen any educational videos for more than half an hour during my exam period, but this video is so well explained that I've spent almost 2 n half hour watching this!
    The contents are so well organised and well explained that everyone can understand it very easily.
    Thanks a million Ma'am from the bottom of heart!

  24. thank you so much madam, really awesome explaination , it is very clear. All the members can understand who are not having coding knowledge also…

  25. Thank you so much mam you have explained the concept of selenium very beautifully, your lecture clear my all doubt of selenium

  26. Excellent tutorial for beginners.. i was always scared to start with automation but after watching this video am ready to start with it again 🙂

  27. Hi. I am getting an exception; Exception in thread "main" java.lang.NullPointerException when getting credentials after the browser has launched. Please help.

  28. Beautifully explained.Its really good tutorial.I didn't bored at all evn though it was two n half hours!

  29. I need classes on Java and selenium..o don't know which Java course I have to start for a testing job ?

  30. waaaooouuh Edureka thank youuu so much !! this is a must watch video, I really enjoyed watching it, I feel bad I did not discover that channel earlier, but now I am stucked to it!! Thank you again and keep up the good work!!

Leave a Reply

Your email address will not be published. Required fields are marked *