The primary new feature in Selenium 2.0 is the integration of the WebDriver API. WebDriver is designed to provide a simpler, more concise programming interface in addition to addressing some limitations in the Selenium-RC API.
Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation. How these direct calls are made, and the features they support depends on the browser you are using.
Selenium webdriver architecture mainly divided into three parts
- Language level bindings
- Selenium Webdriver API
1) Language Level Bindings :
Languages in which are making an framework, will interact with the Selenium Webdriver and work on various browsers and other devices. So we have a common API that we use for Selenium that has a common set of commands and we have various bindings for the different languages. So you can see there’s Java, Java, Python, Ruby, there’s also some other bindings and new bindings can be added very easily.
2) Selenium Webdriver API:
Now these bindings communicate with Selenium Webdriver API and and this API send the commands taken from language level bindings interpret it and sent it to Respective driver. In basic term it contains set of common library which allow to send command to respective drivers.
Drivers here at the right hand side, you see we have various internet browser specific drivers such as IE driver, a Firefox, Chrome, and other drivers such as HTML unit which is an interesting one. It works in headless mode which make text execution faster. It also contains mobile specific drivers as well. But the basic idea here is that each one of these drivers knows how to drive the browser that it corresponds to.
Actually whatever the commands issued in the code will be interpreted into Webservice methods (JSON Wired Protocol) and the Remote Driver will receive the HTTP request (commands) and execute them in the browser then send the response back.
Limitations of WebDriver
- WebDriver Cannot Readily Support New Browsers
- WebDriver has no built-in command that automatically generates a Test Results File.