keyboard_arrow_up

selenium webdriver

WebDriver And It’s Comparison With Selenium RC

Web Driver is an automation tool of Software Testing, that aims to execute tests against different browsers.

Web Driver enables the usage of a programming languages in creating test scripts; which isnot possible in Selenium IDE. It enables conditional operations like if-then-else or switch-case and also looping like do-while.

software-testing

The programming languages supported by Web-Driver are:

  • Java
  • .Net
  • PHP
  • Python
  • Perl
  • Ruby

Web Driver Vs Selenium RC

Web Driver succeeded Selenium Remote Control. Features common in both Web Driver and Selenium RC are:

  • Both enables usage of programming language in designing test scripts.
  • Both allows to run tests against different browsers.

So what are the differences?

The architecture

Selenium Remote Control (RC) has a complicated architecture. It allows to write automated web application UI tests in any programming language against any HTTP website using mainstream JavaScript-enabled browser. RC Server fetches the next instruction from test scripts to repeat the whole cycle. Selenium RC is slower since it uses a JavaScript program called Selenium Core which is the one that directly controls the browser.

Web Driver’s architecture is simpler than Selenium RC’sIt controls the browser from the OS level And all needed are programming language’s IDE (which contains Selenium commands) and a browser. Web Driver is also faster than Selenium RC since it speaks directly to the browser.

Web Driver interacts with page elements in a more realistic way. For example, if there is a disabled text box on a page that is being tested, Web Driver cannot enter any value in it.

Selenium Core could access disabled elements.

API differences

Selenium RC’s API though mature,contains redundancies and often perplexingcommands. For example, most of the time, testers are confused whether to use type or type Keys. What makes matter worse is that different browsers interpret each of these commands in different ways.

Web Driver’s API is simpler than Selenium RC’sIt has no redundancy and not perplexing.

The browser support

Web Driver can support the headless HTML Unit browser. It is termed “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 test execution cycles. Since it is invisible to the user, it can only be controlled through automated means.

Selenium RC cannot support the headless HTML Unit browserIt needs a real, visible browser to operate on.

Limitations of Web Driver

Web Driver Cannot support new browsers; since Web Driver operates on the OS level and 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, the Web Driver team requires some time to figure that new process before they can implement it on the next Web Driver release.
Selenium RC Has Built-In Test Result Generator.

Selenium RC automatically generates an HTML file of test results whose format was Pre-Set by RC itself.

Web Driver has no built-in command that automatically generates a Test Results FileOne has to rely on IDE’s output window, or design the report oneself using the capabilities of programming language and store it as text, HTML, etc.

Summary:

Selenium-Web Driver makes direct calls to the browser using each browser’s native support for automation.

Selenium-RC worked the same way for each supported browser. It ‘injected’ JavaScript functions into the browser when the browser was loaded and then used its JavaScript to drive the AUT within the browser.

Web Driver does not use this technique. Again, it drives the browser directly using the browser’s built in support for automation.

There are some reasons though to use the Selenium-Server with Selenium-Web Driver.

  • If you are using Selenium-Grid to distribute your tests over multiple machines or virtual machines (VMs).

  • If you want to connect to a remote machine that has a particular browser version that is not on your current machine.

  • If you are not using the Java bindings and would like to use HTML Unit Driver.