This document provides an overview of Selenium and its components for cross-browser testing. It discusses Selenium IDE, Selenium Remote Control (RC), Selenium WebDriver, and Selenium Grid. It then focuses on Selenium WebDriver, explaining its architecture which includes Selenium client libraries, the JSON Wire Protocol, browser drivers, and browsers. It provides examples of using the Firefox and Chrome WebDriver and discusses setting up the ChromeDriver binary. It concludes by encouraging the reader to try out Selenium WebDriver and share any other questions.
3. Components of the
Selenium Suite
â Selenium Integrated Development
Environment (IDE)
â Selenium Remote Control (RC)
â Selenium WebDriver
â Selenium Grid
4. Selenium Integrated
Development
Environment
Selenium IDE is a simple Firefox
Plugin and it is used to record &
playback scripts. However, the
Selenium IDE can only be used to
write automation scripts for automating
testing of simple use cases. Selenium
IDE does not support Conditional
statements, Exception handling, loops,
screenshot capture, etc.
5. Selenium Remote
Control
For testing complex scenarios,
Selenium Remote Control (RC) can
be used. It is based on the client-
server model which makes it possible
to execute tests on the browser that is
controlled by the server. There are
client libraries in different
programming languages which make
it easy for developers to write
effective test cases
6. Selenium WebDriver
The primary focus of our Selenium
WebDriver tutorial. By far, we know
that Selenium IDE is GUI based,
where Selenium RC is a standalone
Java program that will allow you to
execute HTML test suites.
Selenium WebDriver framework is
more widely used when compared
to Selenium IDE & Selenium RC.
7. Serial testing is fine till the time you
have to test code that is confined to
few browsers, operating systems, or
devices. However, the testing
methodology would falter once
testing has to be formed in an
environment that has multiple
combinations.
Selenium Grid
8. As a part of Selenium WebDriver tutorial,
it is imperative to have a look at the
major blocks that comprise the Selenium
WebDriver architecture:
â Selenium Client Libraries
â JSON Wire Protocol
â Browser Drivers
â Browsers
Selenium WebDriver
Architecture
9. Selenium Client
Libraries
As mentioned earlier, developers
can use Selenium to write test
code in different languages like
C#, Java, Python, Perl, etc. The
multi-language support is possible
due to Selenium Client Libraries or
Selenium Language Bindings.
10. JSON Wire Protocol
JSON (JavaScript Object Notation)
Wire Protocol facilitates the
transfer of data between the Client
& Server. It is REST
(Representational State Transfer)
based API. Each browser will have
its own browser driver.
11. Browser Driver is mainly used for
communicating with the
browsers. Since the internal logic
of the browser & its functionality
is not revealed, Browser Driver
ensures the necessary layer of
âencapsulationâ in order to keep
execution level details more
abstract.
Browser Drivers
12. Since Browser Drivers are
available for popular browsers
like Chrome, Firefox, Internet
Explorer, Safari, Microsoft Edge,
etc., you can use either of them
for performing cross browser
testing. It should be noted that
you cannot perform cross
browser testing of a website on a
browser whose Browser Driver is
not publicly available.
Browsers
13. Now that you are aware of the
basics of Selenium and Browser
Drivers, it is time we have a look
at a simple WebDriver script in
our Selenium WebDriver tutorial.
Before we look at the example,
please make sure that you have
the programming environment
ready i.e. download the IDE of
your choice (We are using the
with all the required
packages/software downloaded
from the Eclipse Marketplace).
Selenium WebDriver In Action
14. The previous section in our
Selenium WebDriver tutorial, we
used the Firefox WebDriver. In this
section, we look at the changes that
are required in case you are using
the Chrome browser for testing.
You should ensure that the
standalone ChromeDriver binary
(which is different than the Chrome
browser binary) is available in the
right path or it is present as a part
of the webdriver.chrome.driver
environment variable.
Chrome WebDriver example
15. So far in our Selenium WebDriver
tutorial, we have demonstrated
cross browser testing using the
Firefox WebDriver & Chrome
WebDriver. In this section, we
look at the changes that are
required in case you are using the
Chrome browser for testing. You
should download the correct
Internet Explorer WebDriver (32
bit/64 bit) from here or here.
Internet Explorer
WebDriver Example
16. That was all from our end in our basic Selenium WebDriver tutorial. We hope this
was useful to you. Do share your questions and thoughts on the same in the
comment section below. We will be upcoming with more blogs revolving around
Selenium, so stay tuned!
www.lambdatest.com
CONCLUSION