Selenium (software)

From Wikipedia, the free encyclopedia
  (Redirected from WebDriver)
Jump to: navigation, search
Stable release 2.47.0 / July 29, 2015; 33 days ago (2015-07-29)
Development status Active
Written in Java
Operating system Cross-platform
Type Software testing framework for web applications
License Apache License 2.0

Selenium is a portable software testing framework for web applications. Selenium provides a record/playback tool for authoring tests without learning a test scripting language (Selenium IDE). It also provides a test domain-specific language (Selenese)[1] to write tests in a number of popular programming languages, including Java, C#, Groovy, Perl, PHP, Python and Ruby. The tests can then be run against most modern web browsers. Selenium deploys on Windows, Linux, and Macintosh platforms. It is open-source software, released under the Apache 2.0 license, and can be downloaded and used without charge.


Selenium was originally developed by Jason Huggins in 2004 as an internal tool at ThoughtWorks. Huggins was later joined by other programmers and testers at ThoughtWorks.,[2] before Paul Hammant joined the team and steered the development of the second mode of operation that would later become 'Selenium Remote Control' (RC). The tool was open sourced that year.

In 2005 Dan Fabulich and Nelson Sproul (with help from Pat Lightbody) made an offer to accept a series of patches that would transform Selenium-RC into what it became best known for. In the same meeting, the steering of Selenium as a project would continue as a committee, with Huggins and Hammant being the ThoughtWorks representatives.

In 2007, Huggins joined Google. Together with others like Jennifer Bevan, he continued with the development and stabilization of Selenium RC. At the same time, Simon Stewart at ThoughtWorks developed a superior browser automation tool called WebDriver. In 2009, after a meeting between the developers at the Google Test Automation Conference, it was decided to merge the two projects, and call the new project Selenium WebDriver, or Selenium 2.0.[3][4][5]

In 2008, Philippe Hanrigou (then at ThoughtWorks) made 'Selenium Grid', which provides a hub allowing the running of multiple Selenium tests concurrently on any number of local or remote systems, thus minimizing test execution time. Grid offered, as open source, a similar capability to the internal/private Google cloud for Selenium RC. Pat Lightbody had already made a private cloud for 'HostedQA' which he went on to sell to Gomez, Inc.

The name Selenium comes from a joke made by Huggins in an email, mocking a competitor named Mercury, saying that you can cure mercury poisoning by taking selenium supplements. The others that received the email took the name and ran with it.[6]

Selenium components[edit]

Selenium IDE[edit]

Selenium IDE is a complete integrated development environment (IDE) for Selenium tests. It is implemented as a Firefox Add-On, and allows recording, editing, and debugging tests. It was previously known as Selenium Recorder. Selenium-IDE was originally created by Shinya Kasatani and donated to the Selenium project in 2006.[7][8]

Scripts may be automatically recorded and edited manually providing autocompletion support and the ability to move commands around quickly. Scripts are recorded in Selenese, a special test scripting language for Selenium. Selenese provides commands for performing actions in a browser (click a link, select an option), and for retrieving data from the resulting pages.

Selenium client API[edit]

As an alternative to writing tests in Selenese, tests can also be written in various programming languages. These tests then communicate with Selenium by calling methods in the Selenium Client API. Selenium currently provides client APIs for Java, C#, Ruby and Python.

With Selenium 2, a new Client API was introduced (with WebDriver as its central component). However, the old API (using class Selenium) is still supported.

Selenium Remote Control[edit]

Selenium Remote Control (RC) is a server, written in Java, that accepts commands for the browser via HTTP. RC makes it possible to write automated tests for a web application in any programming language, which allows for better integration of Selenium in existing unit test frameworks. To make writing tests easier, Selenium project currently provides client drivers for PHP, Python, Ruby, .NET, Perl and Java. The Java driver can also be used with JavaScript (via the Rhino engine). A new instance of selenium RC server is needed to launch html test case - which means that the port should be different for each parallel run.[citation needed] However, for Java/PHP test case only one Selenium RC instance needs to be running continuously.[citation needed]

Selenium Remote Control was a refactoring of Driven Selenium or Selenium B designed by Paul Hammant, credited with Jason as co-creator of Selenium. The original version directly launched a process for the browser in question, from the test language of Java, .Net, Python or Ruby. The wire protocol (called 'Selenese' in its day) was reimplemented in each language port. After the refactor by Dan Fabulich, and Nelson Sproul (with help from Pat Lightbody) there was an intermediate daemon process between the driving test script, and the browser. The benefits included the ability to drive remote browsers, and the reduced need to port every line of code to an increasingly growing set of languages. Selenium Remote Control completely took over from the Driven Selenium code-line in 2006. The browser pattern for 'Driven'/'B' and 'RC' was response/request, which subsequently became known as Comet.

With the release of Selenium 2, Selenium RC has been officially deprecated in favor of Selenium WebDriver.

Selenium WebDriver[edit]

Selenium WebDriver is the successor to Selenium RC. Selenium WebDriver accepts commands (sent in Selenese, or via a Client API) and sends them to a browser. This is implemented through a browser-specific browser driver, which sends commands to a browser, and retrieves results. Most browser drivers actually launch and access a browser application (such as Firefox or Internet Explorer); there is also an HtmlUnit browser driver, which simulates a browser using HtmlUnit.

Unlike in Selenium 1, where the Selenium server was necessary to run tests, Selenium WebDriver does not need a special server to execute tests. Instead, the WebDriver directly starts a browser instance and controls it. However, Selenium Grid can be used with WebDriver to execute tests on remote systems (see below).

In practice, this means that the Selenium 2.0 API has significantly fewer calls than does the Selenium 1.0 API. Where Selenium 1.0 attempted to provide a rich interface for many different browser operations, Selenium 2.0 aims to provide a basic set of building blocks from which developers can create their own Domain Specific Language. One such DSL already exists: the Watir project in the Ruby language has a rich history of good design. Watir-webdriver implements the Watir API as a wrapper for Selenium-Webdriver in Ruby. Watir-webdriver is created entirely automatically, based on the WebDriver specification and the HTML specification.

As of early 2012, Simon Stewart (inventor of WebDriver), who was then with Google and now with Facebook, and David Burns of Mozilla were negotiating with the W3C to make WebDriver an internet standard. In July 2012, the working draft was released.[9] As such, Selenium-Webdriver (Selenium 2.0) aims to be the reference implementation of the WebDriver standard in various programming languages. Currently Selenium-WebDriver is fully implemented and supported in Python, Ruby, Java, and C#.

Selenium Grid[edit]

Selenium Grid is a server that allows tests to use web browser instances running on remote machines. With Selenium Grid, one server acts as the hub. Tests contact the hub to obtain access to browser instances. The hub has a list of servers that provide access to browser instances (WebDriver nodes), and lets tests use these instances. Selenium Grid allows running tests in parallel on multiple machines, and to manage different browser versions and browser configurations centrally (instead of in each individual test).

The ability to run tests on remote browser instances is useful to spread the load of testing across several machines, and to run tests in browsers running on different platforms or operating systems. The latter is particularly useful in cases where not all browsers to be used for testing can run on the same platform.

The Selenium ecosystem[edit]

Many other tools support, integrate with and extend Selenium.[10]

Popular tools integrating with Selenium[edit]

Below are several notable tools that make it easy to run Selenium tests and view their results:

  • Jenkins provides plugins for integrating Selenium test results,[11] and running Selenium Grid.[12]
  • Grails provides a plugin for easily adding Selenium tests to a Grails application.[13]
  • Apache Maven provides Selenium 2 artifacts in the central Maven repository.[14]
  • Visual Studio provides a plugin for running Selenium tests from Visual Studio programs.[15]
  • Drupal’s internal testing framework, SimpleTest, provides a Selenium integration.[16]
  • Silk Central is a test management platform that allows users to achieve real-time reporting and the ability to run Selenium scripts.[17]
  • Soatest is an API Testing tool that can use the Selenium WebDriver framework for Web UI testing, including cross-browser testing[18]
  • Appium is a mobile test automation framework (and tool) for native, hybrid and mobile-web apps for iOS and Android. It uses JSONWireProtocol internally to interact with iOS and Android apps using Selenium’s WebDriver.[19]
  • Bstriker ALTM allows users to create, import and play Selenium scripts in multiple browsers.[20]
  • TAZ Automation directly runs Selenium IDE commands (scriptless) in a full-functioned Test Execution Manager. [21]
  • Protractor end to end testing for AngularJS
  • Webmate is a cloud-based service for cross-browser, regression, and layout-testing of web applications that uses Selenium internally to drive the browsers that are used for executing tests. [22]
  • SmartBear supports Selenium WebDriver through their TestComplete and QAComplete tools, providing reusability, test management and reporting capabilities. [23]

Services running Selenium on the cloud[edit]

The following are commercial services that allow users to run their Selenium tests on a large number of browsers/OS combinations, on machines running in the cloud. Most services offer the ability to capture screenshots and videos of Selenium tests, and a secure tunnel for testing web applications running on premises behind a firewall. Pricing is based on total time of tests run per month and maximum concurrent tests allowed.

Following are details for several notable Selenium services.

Vendor Browser/OS combinations Screenshots/videos Secure tunnel set-up Mobile support


Live screencast of tests as they run

Download binaries and run from command line[25]

Real Android and iOS browsers[26]

Sauce Labs


Live screencasts of running tests, screenshots and video recordings of past tests

Download binaries and run from command line[28]

Android and iOS browsers and hybrid apps[29]



Screenshots of live and past tests

No setup required, tests run locally in secure containers




Remote access, screenshots, logcats, trends

API, Automated and Manual[32]

Android and iOS, hybrid and web apps[33]



Screenshots of past tests, visual comparison, various screen resolutions, Selenium IDE integration

Ngrok based[35]

Android browsers[36]



Screenshots and video recordings of past tests


Android and iOS browsers and hybrid apps[39]



Video recordings of past tests

Gridlastic Connect high performance TLS tunnel


See also[edit]


  1. ^ "Selenium Commands – "Selenese"". Selenium Documentation. Retrieved September 9, 2011. 
  2. ^ "Selenium History". Selenium HQ. Retrieved June 29, 2014. 
  3. ^ "The Selenium Project". NewCircle. Retrieved June 29, 2014. 
  4. ^ "Relationships between different versions of Selenium". Yi Zeng. Retrieved June 29, 2014. 
  5. ^ "Selenium WebDriver". Simon Stewart, the Architecture of Open Source Applications. Retrieved June 29, 2014. 
  6. ^ Krill, Paul (April 6, 2011). "Open source Selenium web app test suite to support iPhone and Android". InfoWorld. Retrieved May 9, 2012. Selenium was so named because Huggins, dissatisfied with testing tools on the market, was seeking a name that would position the product as an alternative to Mercury Interactive QuickTest Professional commercial testing software. The name, Selenium, was selected because selenium mineral supplements serve as a cure for mercury poisoning, Huggins explained. 
  7. ^ "Selenium History". Selenium HQ. Retrieved March 3, 2015. 
  8. ^ "Selenium Recorder 0.6 Released". Shinya Kasatani. Retrieved March 3, 2015. 
  9. ^ "WebDriver: W3C Working Draft 10 July 2012". Retrieved February 22, 2015. 
  10. ^ "Selenium Ecosystem". Selenium HQ. Retrieved July 2, 2014. 
  11. ^ "Seleniumhq Plugin". Jenkins Wiki. Retrieved July 2, 2014. 
  12. ^ "Selenium Plugin (Selenium Grid)". Jenkins Wiki. Retrieved July 2, 2014. 
  13. ^ "Selenium Plugin". Retrieved July 2, 2014. 
  14. ^ "Maven Information". Selenium HQ. Retrieved July 2, 2014. 
  15. ^ "Selenium components for Coded UI Cross Browser Testing". MSDN Visual Studio Gallery. Retrieved July 2, 2014. 
  16. ^ "Download & Extend - Selenium". Retrieved July 2, 2014. 
  17. ^ Retrieved November 26, 2014.  Missing or empty |title= (help)
  18. ^ "API Testing". Retrieved April 3, 2015. 
  19. ^ "The Basics Of Test Automation For Apps, Games And The Mobile Web". SmashingMagazine. Retrieved January 21, 2015. 
  20. ^ "Bstriker International BV". Retrieved March 7, 2015. 
  21. ^ "Aztaz Software". Retrieved May 14, 2015. 
  22. ^ "webmate features". Retrieved July 13, 2015. 
  23. ^ Bridgewater, Adrian. "SmartBear Supports Selenium WebDriver". Dr. Dobbs. Retrieved 11 August 2015. 
  24. ^ "Browsers & Mobile Devices for Selenium Testing". BrowserStack. Retrieved July 2, 2014. 
  25. ^ "Local Testing". BrowserStack. Retrieved July 2, 2014. 
  26. ^ "Browsers & Mobile Devices for Selenium Testing - Apple & iOS". BrowserStack. Retrieved July 2, 2014. 
  27. ^ "Device/OS/Browser Platforms". Sauce Labs. Retrieved July 2, 2014. 
  28. ^ "Sauce Connect". Sauce Labs. Retrieved July 2, 2014. 
  29. ^ "Build exceptional mobile apps". Sauce Labs. Retrieved July 2, 2014. 
  30. ^ "Selenium on Spoonium". Spoonium. Retrieved July 2, 2014. 
  31. ^ "Device/OS/Browser Platforms". Testdroid. Retrieved September 30, 2014. 
  32. ^ "Testdroid Cloud API". Testdroid. Retrieved September 30, 2014. 
  33. ^ "Appium,Selenium,Testdroid". Testdroid. Retrieved September 30, 2014. 
  34. ^ "List of available browsers". Equafy. Retrieved October 11, 2014. 
  35. ^ "Equafy Tunnel". Equafy. Retrieved October 11, 2014. 
  36. ^ "Mobile Testing". Equafy. Retrieved October 11, 2014. 
  37. ^ "List of available browsers". TestingBot. Retrieved July 2, 2014. 
  38. ^ "TestingBot Tunnel". TestingBot. Retrieved July 2, 2014. 
  39. ^ "Mobile Testing". TestingBot. Retrieved July 2, 2014. 
  40. ^ "List of available browsers". Gridlastic. Retrieved September 17, 2014. 

External links[edit]