Jason
Huggins created Selenium in 2004. He was an engineer in Thoughtworks. There he
was working on a web application which required regular testing. Realizing the
inefficiency of repeated manual testing, he created 'JavaScriptTestRunner', a
program in JavaScript which could control the browser actions. He made it open
source considering that more web applications could be automated using this
program.
The Name:
Another
framework for automated testing popular during those days was QTP, by the
company Mercury Interactive. As Selenium is an antidote for Mercury,
'JavaScriptTestRunner' was hence renamed Selenium, as a competitor for Mercury
Interactive, on pure grounds of wit.
Apart
from being an open source tool, another factor that makes it popular is the
multiple programming languages supported by it. It supports, Java, C#, PHP,
Python, Perl and Ruby. Most of the popular browser vendors have also initiated
processes to make their browsers compatible to it.
The Components:
Selenium is a combination
of the following tools:
1.
Selenium
IDE(Integrated Development Environment): Shinya Kasatani
from Japan developed this IDE and donated it to the Selenium project on 2006.
It is a Firefox Extension which automates the browser using a record and playback
feature. It records user actions and then saves them as a reusable script in
one of the programming languages. This exported file can be later on executed
repeatedly.
2.
Selenium RC(Remote Control) also known
as Selenium 1: Testers who were using Selenium Core required to
install the whole application and the web server in their local setup. To overcome this, Paul Hammant created
Selenium RC, which acted as HTTP proxy which made the browser believe that the
Selenium Core and the webserver come from the same domain.
3.
Selenium Web Driver: In
2006, the browsers and web applications were becoming more restrictive with
running Javascript programs. Simon Stewart then created Selenium WebDriver which was the first cross platform testingframework. It could control the browser from the Operating System
level. In 2008, Selenium RC was merged with Web Driver to form Selenium 2.
WebDriver supports HTMLUnitbrowser which is generally used for functional
testing.
4.
Selenium Grid: Patrick
Lightbody developed Selenium Grid to minimize the time required for test
execution. It captured browser screenshots and performed parallel tests on
multiple browsers on multiple machines. It controlled multiple environment from
a central location. Thus, for a large
test suite, or a slow running test suite, Selenium Grid divides the test suit
and runs different tests on different machines at the same time. This parallel
processing greatly minimizes the time required to execute the entire test
suite.
Basic Concept:
Selenium works on a Page Object Model which is an object oriented library that
brings object oriented programming into test scripts. Here, web pages are the
classes and its elements are assumed as
its variables. All the user interactions are treated as methods in this
class. Page Factory in Selenium is an extension to the Page Object Model. It initializes the web
elements in the web page classes. The elements can be used only after their
initialization.
Conclusion:
Selenium
has been made to be very flexible. New functionalities can be added to both the
test script and the framework to customize test automation. Also, as it is an
open source software, its source code can be easily downloaded and modified as
per requirement.