Monday 18 June 2012

Selenium 2.0 / (Selenium + Web Driver)

Today we will talk about the need of Selenium 2.0 which is a result of merger between Selenium 1.0 & Web Driver. Selenium is capable Web Browser automation tool then why merged with Web Driver, What is web driver , what benefits it will bring to existing Selenium. Lets see those 1/1.


What is Web Driver?
        Web Driver is a set of API developed by Open Source team which can be used to automate browser tasks. Like Selenium, it can be hooked by many language bindings (Java , C#, Python etc). It is like the end user, simulates the user action on the html of the browser. 


Benefits of Web Driver
        1) Web Driver is built with the approach of Object Oriented.
        2) This means code re usability, ease to use and complexity of numbers of methods are very less.
        3) Every browser it supports, supported natively.This means there will not be java script execution for each action on HTML elements in the web page. 
        4) The above is a breakthrough reason for adopting Web Driver.

     Selenium 1.0 merged with Web Driver to create Selenium 2.0 through which user can use the benefits of Selenium and Web Driver both. Where as Selenium uses Java Script as the simulating user performing action engine, Web Driver uses native browser mechanism to perform the actions. In some situations, where underlying browser can not be used for native events, it takes help from Selenium..

A example to detail the above will be -: Lets say a user wants to find some element using XPATH in Internet Explorer. But IE does not support XPATH natively, so what should web driver do in this case, It takes help from Selenium, using java script method, finds the element.

Then what does it mean by natively support. It means in simple terms, if user wants to find a HTML element having id="myElement" then using Web Driver you can simply ask the used browser that give me the web element whose id="myElement" in this page. And browser obeys to this and give it back to Web Driver.

In the next post, I will be detailing about the Web Driver API and how to use it.

Thanks!!
         







No comments:

Post a Comment

Related Posts

Related Posts...