⇓ Get Latest Updates ⇓

Enter your email address:

Check email in your inbox for confirmation to get latest updates Software Testing for free.

⇓ Categories ⇓

Netsparker Web Application Security Scanner

Introduction To WebDriver And Its Comparison With Selenium RC - [Learn Selenium Basics]

In the past chapters, we learnt about “How To Enhance A Script Using Selenium IDE?” and created simple tests using it. In today’s chapter, we are going to learn about Selenium WebDriver which is an advance tool and a mechanism to create more powerful test scripts than Selenium IDE.


Selenium WebDriver:

It is web automation testing framework that assists to execute tests across various web browsers. Thus, it is more flexible and powerful framework to write web testing automation scripts. Selenium WebDriver supports HTMLUnit and Firefox by default and other browser such as Internet Explorer, Safari, PhantomJS, Opera and Chrome with additional component known as Driver Server.

Selenium WebDriver Image1

Click image to enlarge.


Browser Support by Selenium WebDriver:

Unlike Selenium IDE, WebDrivers can be used to write tests using various programming languages such as Java, .Net, etc. With the use of programming language, we need not to just rely on the in-built functions sincewe can leverage programming language features such as conditional operations (if-else or switch-case-default statements), looping (for-loop, while-loop), constant and variables declarations, etc. Following are the programming languages that are supported by the Selenium WebDrivers:

  1. Java
  2. .Net
  3. PHP
  4. Python
  5. Perl
  6. Ruby
Selenium WebDriver Supported languages

Programming language supported by Selenium WebDriver


Therefore, choose the programming language that you understand well while working with Selenium WebDriver. In this tutorial, we are going to use JAVA as programming language and Eclipse as IDE.


WebDriver vs Selenium RC:

Selenium RC exists before Selenium WebDriver back in 2006. Both have the common features givenas follows.

  • Test scripts can be written in different programming languages.
  • Tests can be executed across different web browsers.

Now the question should be, what is the actual difference? To understand that let’s take a look at Selenium RC architecture.


Selenium RC (Remote-Control) Architecture:

Selenium RC (Remote-Control) is a testing framework or tool that assists in writing automated web application GUI tests in different programming language such as JAVA, .NET, Perl, Python, etc. against any HTTP website via JavaScript-enabled browser. Selenium RC as two parts.

  1. A remote control server that launches and kills web browsers and behaves as a HTTP proxy for different web requests from them
  2. Client libraries that supports different programming languages.


Following points to be remembered about Selenium RC’s architecture.

  • Before we can start actual testing, we need to launch a separate application called Selenium Remote (RC) Server.
  • From the architecture diagram, it is clear that RC Server is a middle layer between our Selenium commands and browser.
  • RC server injects a JavaScript program known as Selenium Core into the web browser when we trigger the actual web testing.
  • Through this injected JavaScript program, Selenium Core receives instructions by the RC Server from the program under test.
  • Upon receiving the instructions, Selenium Core executes these instructions as JavaScript command statements.
  • The browser receives the instructions from Selenium Core and relays its response to the Selenium RC Server.
  • Using the response received by the RC Server, the test results are displayed to the user.
  • Same cycle is repeated instruction by instruction until entire test is completed.
Selenium RC

Selenium RC (Remote Control) Architecture


WebDriver Architecture

Comparatively, WebDriver architecture is simpler than Selenium RC architecture as explained above. Selenium WebDriver architecture has the following two parts.

  1. Browser is controlled by WebDriver at Operating System (OS) level unlike RC Server.
  2. We require programming language’s IDE that has Selenium test commands and a web browser to run the website.

Selenium WebDriver Architecture


After discussing both the architectures, we can conclude that Selenium RC’s architecture is more complicated than Selenium WebDriver architecture.


Comparison between Selenium WebDriver and Selenium RC:

S. No. Factor WebDriver Selenium RC
1. Operating Speed WebDriver operating speed is faster than Selenium RC as it uses the web browser’s own engine to control it. Selenium RC has slow operating speed as compared to WebDriver as uses a JavaScript program known as Selenium Core which interacts with the browser and is the indirect control.
2. Interactions with GUI elements Interaction of WebDriver is very realistic such as if any web page element is disabled that we cannot access and enter the value into it, the similar way WebDriver also cannot access that element. Interaction of Selenium RC is not realistic as it operates by JavaScript code which can access disabled elements from the web page and enter the value into it. Such feature may end up giving inappropriate test results.
3. API Complexities WebDriver API commands are very simple, non-redundant and easy to understand. Selenium RC API is matured but has redundancies in commands which are sometimes very confusing while writing the test scripts. For example, testers are often getconfused withthe use type or typeKeys; and the use ofclick, mouseDown or mouseDownAt, etc.
4. Browser Support It support headless HTMLUnit browser. The term headless means that the browser is invisible to the user andit runsweb tests on virtual web browser which removes the overhead of waiting to load web page elements. It enhances the test execution speed. Selenium RC does not support headless HTMLUnit browser. It requires the actual visible browser, so that it can inject the JavaScript code to do the required tests.
5. Programming Languages Support It supports programming languages such as Java, .Net, PHP, Python, Perl and Ruby. It also supports programming languages such as Java, .Net, PHP, Python, Perl and Ruby.
6. Support for New web Browsers Webdriver default support is for HTMLUnit and Firefox web browser. It can support other browsers such as Safari, IE with the help of additional components known as Driver Server. Therefore, if there is a new browser that is launched in the market in future then there will be a need to develop a new Driver Server in order to get support from WebDriver. With Selenium RC, as long as it can able to inject the JavaScript code or Selenium core for request and response it can support any web browser for testing.
7. Built-In Test Result Generator WebDriver do not have any kind of built-in test result generator and for test results it relies on IDE’s output window. Selenium RC has in-built test result generator that generates an HTML file of test results. RC has pre-set format for this file. This file helps RC to prepare the test results.



In this chapter we have discussed about and Selenium WebDriver and RC architecture and later compared their utilities as an automated web testing tool.
If you are not regular reader of this website then highly recommends you to Sign up for our free email newsletter!! Sign up just providing your email address below:

Enter your email address:

Check email in your inbox for confirmation to get latest updates Software Testing for free.

Happy Testing!!!

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>