0% found this document useful (0 votes)
26 views

01_01_Selenium Overview- Selenium Webdriver

Uploaded by

minhtandragon29
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

01_01_Selenium Overview- Selenium Webdriver

Uploaded by

minhtandragon29
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 43

Selenium Overview

May-2019

1
RBVH/ENG1

Content

 What is Selenium?
 Who developed Selenium?
 The Same Origin Policy Issue
 Birth of Selenium Remote Control (Selenium RC)
 Birth of Selenium Grid
 Birth of Selenium IDE
 Birth of WebDriver
 Birth of Selenium 2
 So, Why the Name Selenium?
 Brief Introduction Selenium IDE
 Brief Introduction Selenium Remote Control (Selenium RC)
 Brief Introduction WebDriver
 Selenium Grid
 Note on Browser and Environment Support
 How to Choose the Right Selenium Tool for Your Need
 A Comparison between Selenium and QTP(now UFT)
 Advantages of QTP over Selenium
2
RBVH/ENG1

What is Selenium?

 Selenium is a free (open source) automated testing suite for web


applications across different browsers and platforms. It is quite similar
to HP Quick Test Pro (QTP now UFT) only that Selenium focuses on
automating web-based applications. Testing done using Selenium tool
is usually referred as Selenium Testing.

Internal | RBVH/ENG1 | 6/24/2014 | © Robert Bosch Engineering and Business Solutions Vietnam Company Limited 2013. All
rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of
applications for industrial property rights.
RBVH/ENG1

What is Selenium? - Includes


Selenium is not just a single tool but a suite of
software's, each catering to different testing
needs of an organization. It has four
components.
Selenium Integrated Development
Environment (IDE)

Selenium Remote Control (RC)

WebDriver

Selenium Grid

Internal | RBVH/ENG1 | 6/24/2014 | © Robert Bosch Engineering and Business Solutions Vietnam Company Limited 2013. All
rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of
applications for industrial property rights.
What is Selenium?

5
Who developed Selenium?

 Primarily, Selenium was created by Jason Huggins in 2004. An


engineer at ThoughtWorks, he was working on a web application that
required frequent testing. Having realized that the repetitious
Manual Testing of their application was becoming more and more
inefficient, he created a JavaScript program that would automatically
control the browser's actions. He named this program as the
"JavaScriptTestRunner."

6
Birth of Selenium Remote Control
(Selenium RC)
 Unfortunately; testers using Selenium Core had to install the
whole application under test and the web server on their own
local computers because of the restrictions imposed by the same
origin policy. So another ThoughtWork's engineer, Paul
Hammant, 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.
This system became known as the Selenium Remote
Control or Selenium 1.

7
Birth of Selenium Grid

 Selenium Grid was developed by Patrick Lightbody to address the


need of minimizing test execution times as much as possible. He
initially called the system "Hosted QA." It was capable of capturing
browser screenshots during significant stages, and also of sending
out Selenium commands to different machines
simultaneously.

8
Birth of Selenium IDE

 Shinya Kasatani of Japan created Selenium IDE, a Firefox


extension that can automate the browser through a record-and-
playback feature. He came up with this idea to further increase the
speed in creating test cases. He donated Selenium IDE to the
Selenium Project in 2006.

9
Birth of WebDriver

 Simon Stewart created WebDriver circa 2006 when browsers and


web applications were becoming more powerful and more restrictive
with JavaScript programs like Selenium Core. It was the first cross-
platform testing framework that could control the browser
from the OS level.

10
Birth of Selenium 2

 In 2008, the whole Selenium Team decided to merge WebDriver and


Selenium RC to form a more powerful tool called Selenium 2,
with WebDriver being the core. Currently, Selenium RC is still
being developed but only in maintenance mode. Most of the Selenium
Project's efforts are now focused on Selenium 2.

11
So, Why the Name Selenium?

12
Brief Introduction Selenium IDE

 Selenium Integrated Development Environment (IDE) is the simplest


framework in the Selenium suite and is the easiest one to learn.
It is a Firefox plugin that you can install as easily as you can with
other plugins. However, because of its simplicity, Selenium IDE
should only be used as a prototyping tool. If you want to create
more advanced test cases, you will need to use either Selenium RC or
WebDriver.

13
Brief Introduction Selenium IDE

14
Brief Introduction Selenium Remote
Control (Selenium RC)
Selenium RC was the flagship testing framework of the whole
Selenium project for a long time. This is the first automated web
testing tool that allowed users to use a programming language
they prefer. As of version 2.25.0, RC can support the following
programming languages:
 Java
 C#
 PHP
 Python
 Perl
 Ruby

15
Brief Introduction Selenium Remote
Control (Selenium RC)

16
Brief Introduction WebDriver

 The WebDriver proves itself to be better than both Selenium IDE and
Selenium RC in many aspects. It implements a more modern and stable
approach in automating the browser's actions. WebDriver, unlike Selenium
RC, does not rely on JavaScript for Automation. It controls the browser
by directly communicating with it.
 The supported languages are the same as those in Selenium RC.
 Java
 C#
 PHP
 Python
 Perl
 Ruby
17
Brief Introduction WebDriver

18
Selenium Grid

 Selenium Grid is a tool used together with Selenium RC to run


parallel tests across different machines and different browsers all at
the same time. Parallel execution means running multiple tests at
once.
 Features:
 Enables simultaneous running of tests in multiple browsers
and environments.
 Saves time enormously.
 Utilizes the hub-and-nodes concept. The hub acts as a central
source of Selenium commands to each node connected to it.

19
How to Choose the Right Selenium Tool for Your Need - Selenium IDE

To learn about concepts on automated testing and Selenium, including:

Selenese commands such as type, open, clickAndWait, assert, verify, etc.

Locators such as id, name, xpath, css selector, etc.

Executing customized JavaScript code using runScript

Exporting test cases in various formats.

To create tests with little or no prior knowledge in programming.


To create simple test cases and test suites that you can export later to RC or
WebDriver.
To test a web application against Firefox and Chrome only.

20
Selenium RC
To design a test using a more expressive language than
Selenese

To run your test against different browsers (except HtmlUnit)


on different operating systems.

To deploy your tests across multiple environments using


Selenium Grid.

To test your application against a new browser that supports


JavaScript.

To test web applications with complex AJAX-based scenarios.

21
WebDriver
To use a certain programming language in
designing your test case.

To test applications that are rich in AJAX-based


functionalities.

To execute tests on the HtmlUnit browser.

To create customized test results.

22
Selenium Grid
To run your Selenium RC scripts in
multiple browsers and operating
systems simultaneously.

To run a huge test suite, that needs


to complete in the soonest time
possible

23
A Comparison between Selenium and
QTP(now UFT)
 Quick Test Professional(QTP) is a proprietary automated
testing tool previously owned by the company Mercury
Interactive before it was acquired by Hewlett-Packard in
2006. The Selenium Tool Suite has many advantages over QTP

24
Advantages of Selenium over QTP
Selenium QTP
Open source, free to use, and free of Commercial.
charge.

Highly extensible Limited add-ons


Can run tests across different browsers Can only run tests in Firefox, Internet
Explorer and Chrome

Supports various operating systems Can only be used in Windows

Supports mobile devices QTP Supports Mobile app test automation (iOS
& Android) using HP solution called - HP Mobile
Center

Can execute tests while the browser is Needs to have the application under test to be
minimized visible on the desktop

Can execute tests in parallel. Can only execute in parallel but using Quality
Center which is again a paid product.

25
Advantages of QTP over Selenium
QTP Selenium
Can test both web and desktop Can only test web applications
applications
Comes with a built-in object Has no built-in object repository
repository
Automates faster than Automates at a slower rate because it
Selenium because it is a fully featured does not have a native IDE and only
IDE. third party IDE can be used for
development
Data-driven testing is easier to perform Data-driven testing is more
because it has built-in global and cumbersome since you have to rely on
local data tables. the programming language's
capabilities for setting values for your
test data
Can access controls within the Cannot access elements outside of the
browser(such as the Favorites bar, web application under test
Address bar, Back and Forward buttons,
etc.)
Provides professional customer No official user support is being offered.
support
26
Has native capability to export test Has no native capability to export
data into external formats runtime data onto external formats
Summary
The entire Selenium Tool Suite is comprised of four components:

• Selenium IDE, a Firefox add-on that you can only use in creating relatively simple test
cases and test suites.
• Selenium Remote Control, also known as Selenium 1, which is the first Selenium tool
that allowed users to use programming languages in creating complex tests.
• WebDriver, the newer breakthrough that allows your test scripts to communicate directly
to the browser, thereby controlling it from the OS level.
• Selenium Grid is also a tool that is used with Selenium RC to execute parallel tests across
different browsers and operating systems.

Selenium RC and WebDriver was merged to form Selenium 2.

Selenium is more advantageous than QTP in terms of costs and


flexibility. It also allows you to run tests in parallel, unlike in QTP
where you are only allowed to run tests sequentially.

27
RBVH/ENG1

Reference

 https://www.guru99.com/introduction-to-selenium.html#1
 http://docs.seleniumhq.org/docs/
 http://docs.seleniumhq.org/download/maven.jsp

28

Internal | RBVH/ENG1 | 6/24/2014 | © Robert Bosch Engineering and Business Solutions Vietnam Company Limited 2013. All
rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of
applications for industrial property rights.
RBVH/ENG1

Selenium Webdriver
May-2019

29
RBVH/ENG1

What is WebDriver?
 WebDriver is a web automation framework that allows you to
execute your tests against different browsers, not just Firefox,
Chrome (unlike Selenium IDE).
 WebDriver also enables you to use a programming language in
creating your test scripts (not possible in Selenium IDE).
 You can now use conditional operations like if-then-else or
switch-case. You can also perform looping like do-while.

30
What is WebDriver?
languages are supported by
WebDriver
 Following programming languages are supported by WebDriver
 Java
 .Net
 PHP
 Python
 Perl
 Ruby
RBVH/ENG1
Difference between Selenium RC and Webdriver

 Before the advent of WebDriver in 2006, there was another,


automation tool called Selenium Remote Control. Both
WebDriver and Selenium RC have following features:
 They both allow you to use a programming language in
designing your test scripts.
 They both allow you to run your tests against different
browsers.

33
Architecture - WebDriver
Architecture - Selenium RC
Speed
Webdriver RC

WebDriver is faster than Selenium Selenium RC is slower since it uses a Javascript


RC since it speaks directly to the program called Selenium Core. This Selenium
Core is the one that directly controls the browser, not
browser uses the browser's own engine
you.
to control it.
Real-life Interaction

WebDriver interacts with page


elements in a more realistic
way. For example, if you have a
disabled text box on a page you
were testing, WebDriver really
cannot enter any value in it just as
how a real person cannot.
Real-life Interaction

Selenium Core, just like other


JavaScript codes, can access
disabled elements. In the past,
Selenium testers complain that
Selenium Core was able to enter
values to a disabled text box in
their tests. Differences in API
API
API
Selenium RC's API is more matured but
contains redundancies and often confusing
commands. For example, most of the time,
testers are confused whether to use type or
typeKeys; or whether to use click, mouseDown, or
mouseDownAt. Worse, different browsers
interpret each of these commands in
different ways too!

WebDriver's API is simpler than Selenium


RC's. It does not contain redundant and confusing
commands.
Browser Support

 WebDriver can support the headless HtmlUnit browser


 HtmlUnit is termed as "headless" because it is an invisible browser - it
is GUI-less.
 It is a very fast browser because no time is spent in waiting for page
elements to load. This accelerates your test execution cycles.
 Since it is invisible to the user, it can only be controlled through
automated means.

 Selenium RC cannot support the headless HtmlUnit browser. It


needs a real, visible browser to operate on.
Limitations of WebDriver

 WebDriver Cannot Readily Support New Browsers


 Remember that WebDriver operates on the OS level. Also, remember
that different browsers communicate with the OS in different ways. If
a new browser comes out, it may have a different process of
communicating with the OS as compared to other browsers. So, you
have to give the WebDriver team quite some time to figure
that new process out before they can implement it on the next
WebDriver release.
Summary
WebDriver is a tool for testing web applications across different browsers using different
programming languages.

You are now able to make powerful tests because WebDriver allows you to use a
programming language of your choice in designing your tests.

WebDriver is faster than Selenium RC because of its simpler architecture.

WebDriver directly talks to the browser while Selenium RC needs the help of the RC Server
in order to do so.

WebDriver's API is more concise than Selenium RC's.

WebDriver can support HtmlUnit while Selenium RC cannot.

The only drawbacks of WebDriver are:


• It cannot readily support new browsers, but Selenium RC can.
• It does not have a built-in command for automatic generation of test results.

You might also like