Selenium Webdriver For Test Automation
- Glasdon Falcao
- Nov 16, 2016
- 2 min read
Selenium is open source software web application automation testing tool. It can helps you in software testing process by doing exactly what you would expect: automate the control of a browser so that repetitive tasks can be automated. It was developed by the "Thought Work" in 2004. It is remarkable tool for the functional software testing.
At a very high level, Selenium is a suite of three tools.
Selenium IDE is an extension for Firefox that allows users to record and playback tests. The record/playback paradigm can be limiting and isn’t suitable for many users.
Selenium WebDriver provides APIs in a variety of languages to allow for more control and the application of standard software development practices.
Selenium Grid makes it possible to use the Selenium APIs to control browser instances distributed over a grid of machines, allowing more tests to run in parallel.
Understanding Selenium Webdriver Architecture:-
Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation. Since there are so many browsers & so many programming languages there is need for common specification which will be provided by WebDriver API. Each browser has to implement this API which is called as Remote WebDriver or Remote WebDriver Server. At a higher level Selenium WebDriver architecture look like this.

The language binding will send the commands across the common driver API, on the other end there is going to be a driver listening to those commands and they will be executed in browser using remote WebDriver and it’s going to return the result/response via API to the code/Binding.

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.
Example:
Let’s take a sample code and see how the data flows between Client bindings, Server.
driver.get("http://www.google.com");
The client library, as soon as it receives the preceding command, will convert it to the JSON format (shown below) and communicate with the Firefox Driver/Remote WebDriver.
http://localhost:7705/ { "url": "http://www.google.com" }
Firefox Driver will speak to the Firefox browser natively, and then the browser will send a request for the asked URL to load.
Selenium Webdriver learning for software testing is not a big task if you have basic knowledge of any one selenium Webdriver supported software development language like Java.
WHY SELENIUM It is rich from the Selenium Tree, Below are the points:
Cost effective: It is an open source tool.
Language: Supports many languages like Java, Ruby, and Python and C #.
Browser: Supports multiple browsers like IE, Mozilla, Opera, Chrome and Safari so can be used for cross browser testing and can be integrated easily to new launched browser.
Framework: Supports multiple frame -works like Junit, TestNG, Bromine, Nunit, Rspec which make the automation more robust and can developed own framework.
Operating System: Supports multiple operating systems like Windows, Apple, Linux and Android.
Time Saving: With the help of selenium grid, Parallel execution of the test cases can be done.
تعليقات