Friday 12 July 2013

Getting started with Selenium Web driver 2.0


Selenium is a very popular open source test automation tool. The tool is named as 'Selenium' based on a comment posted by Huggins in one of his mail to his peers. He said a comment by mocking a competitor named Mercury, saying that you can cure mercury poisoning by taking Selenium supplements (hope you guys remember that a element named selenium in the periodic tables). Later the name itself used for this tool. 


Selenium has the following components
  • Selenium IDE
  • Selenium Remote Control
  • Selenium Web Driver
  • Selenium Grid

Selenium IDE is an integrated development environment for Selenium scripts. It is implemented as a Firefox browser plug-in which allows you to record, play, edit, and debug tests. It is good for beginners. As a automation tester you can use this tool as a reference tool to find your web elements. Even though it has some features, IDE has more drawbacks. 

It does not give your test suite reports
It does not take snapshots (Now, it has option to take snapshot on failure)
It does not handle browsers in multiple window
Apart from that, the main thing is it only runs in Firefox browser :)

Selenium Remote Control (RC) is a component that allows you to write automated web application UI tests in any programming language using any mainstream JavaScript-enabled browser.
Selenium RC comes in two parts. 
  • A server which automatically launches and kills browsers, and acts as a HTTP proxy for web requests from them.
  • Client libraries for your favorite computer language.
Even though, RC has overcome the drawbacks of IDE, there are some advantages to migrate to Web driver 2.0

  • Multi-browser testing including improved functionality for browsers not well-supported by Selenium-1.0.
  • Handling multiple frames, multiple browser windows, popups, and alerts.
  • Support for iPhone and Android testing
  • Better features for Ajax testing.
  • Unlike RC you dont have to start a server in webdriver.
  • You can simulate movement of a mouse using selenium.
  • You can find coordinates of any object using Webdriver.
  • You have classes in Webdriver which help you to simulate key press events of keyboard.
Selenium Web driver 2.0

Using Web driver API, you can Drive a browser natively as a user would either locally or on a remote machine using the Selenium Server.

Why Selenium Web driver?

  • Support for mobile phone testing
  • Ajax testing
  • Native browser
  • Explicit and implicit waits
  • Browser manipulation
  • Remote web driver etc
Selenium Grid allows you to run Selenium tests in parallel, cutting down the time required for running acceptance tests to a fraction of the total time it currently takes. Run them all on a single machine or on a server farm.

It allows you to, 
  • manage multiple environments from a central point, making it easy to run the tests against a vast combination of browsers / OS.
  • minimize the maintenance time for the grid by allowing you to implement custom hooks to leverage virtual infrastructure for instance.

No comments:

Post a Comment

Angular JS Protractor Installation process - Tutorial Part 1

                     Protractor, formally known as E2E testing framework, is an open source functional automation framework designed spe...