What is WebDriver ?
- WebDriver in selenium is an Interface and it is designed to overcome some limitations of Selenium RC.
- WebDriver is a purely object oriented framework that works on OS layer, also utilizes the browser’s native compatibility to automation without using any peripheral entity.
- WebDriver also supports various web automation framework that allows you to execute your tests/scripts against different browsers, not just Firefox (unlike Selenium IDE).
- Also known as Selenium-2.0 and used for web as well mobile applications automation.
- most extensively used open source automation testing tool and mostly used for regression testing.
- Selenium WebDriver's development is in process to overcome few limitations and known issues available in selenium WebDriver.
- Ref : http://docs.seleniumhq.org/
WebDriver also enables you to use a programming language in creating your test scripts(not possible in Selenium IDE).
- WebDriver in selenium is an Interface and it is designed to overcome some limitations of Selenium RC.
- WebDriver is a purely object oriented framework that works on OS layer, also utilizes the browser’s native compatibility to automation without using any peripheral entity.
- WebDriver also supports various web automation framework that allows you to execute your tests/scripts against different browsers, not just Firefox (unlike Selenium IDE).
- Also known as Selenium-2.0 and used for web as well mobile applications automation.
- most extensively used open source automation testing tool and mostly used for regression testing.
- Selenium WebDriver's development is in process to overcome few limitations and known issues available in selenium WebDriver.
- Ref : http://docs.seleniumhq.org/
WebDriver also enables you to use a programming language in creating your test scripts(not possible in Selenium IDE).
Some of the limitations imposed by Selenium IDE are:
Some of the limitations imposed by Selenium IDE are:
- Doesn’t support iterations and conditional statements
- Doesn’t support loops
- Doesn’t support error handling
- Doesn’t support test script dependency
- Doesn’t support iterations and conditional statements
- Doesn’t support loops
- Doesn’t support error handling
- Doesn’t support test script dependency
- You can now use conditional operations like if-then-else or switch-case
- You can also perform looping like do-while complex scripts..etc
Following programming languages are supported by WebDriver
- Java
- .Net
- PHP
- Python
- Perl
- Ruby
- Selenium 2 supports most of all browsers to run your test cases and many programming languages like C#, Java, Python, Ruby, .Net, Perl, PHP, etc.. to create and modify your test scripts.
- Selenium 2(WebDriver) controls browser directly from operating system level so it is interacting very fast and with more realistic way with browsers.
- Major people in world using Selenium webdriver with java.
- You can now use conditional operations like if-then-else or switch-case
- You can also perform looping like do-while complex scripts..etc
Following programming languages are supported by WebDriver
- Java
- .Net
- PHP
- Python
- Perl
- Ruby
- Selenium 2 supports most of all browsers to run your test cases and many programming languages like C#, Java, Python, Ruby, .Net, Perl, PHP, etc.. to create and modify your test scripts.
- Selenium 2(WebDriver) controls browser directly from operating system level so it is interacting very fast and with more realistic way with browsers.
- Major people in world using Selenium webdriver with java.
WebDriver Vs Selenium RC :
Difference between WebDriver and selenium RC :
- Before advent of WebDriver in 2006, there was another, automation tool called Selenium Remote Control.Both WebDriver and Selenium RC have following features :
- They both allow you to use a programming language in designing your test scripts.
- They both allow you to run your tests against different browsers.
WebDriver :
- Selenium WebDriver do not require selenium server for running test.
- WebDriver is using native automation from each and every supported language for running automation scripts on browsers.
- WebDriver supports web as well mobile application testing so you can test mobile applications (iPhone or Android).
- Supporting latest versions of almost all browsers.
- WebDriver controls the browser itself.
Selenium RC :
- Required selenium server for running test.
- Selenium RC is using JavaScripts to drive automation with browser.
- Selenium RC supports only web application testing.
- Supporting all browsers but not supporting latest versions.
- Selenium RC is using javascript to interact and operate on web page
Difference between WebDriver and selenium RC :
- Before advent of WebDriver in 2006, there was another, automation tool called Selenium Remote Control.Both WebDriver and Selenium RC have following features :
- They both allow you to use a programming language in designing your test scripts.
- They both allow you to run your tests against different browsers.
- Selenium WebDriver do not require selenium server for running test.
- WebDriver is using native automation from each and every supported language for running automation scripts on browsers.
- WebDriver supports web as well mobile application testing so you can test mobile applications (iPhone or Android).
- Supporting latest versions of almost all browsers.
- WebDriver controls the browser itself.
- Required selenium server for running test.
- Selenium RC is using JavaScripts to drive automation with browser.
- Selenium RC supports only web application testing.
- Supporting all browsers but not supporting latest versions.
- Selenium RC is using javascript to interact and operate on web page
Architecture :
WebDriver's architecture is simpler than Selenium RC's :
Architecture :
WebDriver's architecture is simpler than Selenium RC's :
Selenium RC's architecture is way more complicated :
- You first need to launch a separate application called Selenium Remote Control (RC) Server before you can start testing
- The Selenium RC Server acts as a "middleman" between your Selenium commands and your browser
- When you begin testing, Selenium RC Server "injects" a Javascript program called Selenium Core into the browser.
- Once injected, Selenium Core will start receiving instructions relayed by the RC Server from your test program.
- When the instructions are received, Selenium Core will execute them as Javascript commands.
- The browser will obey the instructions of Selenium Core, and will relay its response to the RC Server.
- The RC Server will receive the response of the browser and then display the results to you.
- RC Server will fetch the next instruction from your test script to repeat the whole cycle.
- You first need to launch a separate application called Selenium Remote Control (RC) Server before you can start testing
- The Selenium RC Server acts as a "middleman" between your Selenium commands and your browser
- When you begin testing, Selenium RC Server "injects" a Javascript program called Selenium Core into the browser.
- Once injected, Selenium Core will start receiving instructions relayed by the RC Server from your test program.
- When the instructions are received, Selenium Core will execute them as Javascript commands.
- The browser will obey the instructions of Selenium Core, and will relay its response to the RC Server.
- The RC Server will receive the response of the browser and then display the results to you.
- RC Server will fetch the next instruction from your test script to repeat the whole cycle.
Speed :
When compared to other tools of Selenium suite, WebDriver turns out to be the fastest tool amongst all. The communication is not channelized via any external intervention; rather the tool directly communicates with the browser same as that of any user. Thus, WebDriver takes advantage of the browser’s native compatibility towards automation.
WebDriver is faster than Selenium RC since it speaks directly to the browser uses the browser's own engine to control it.
Selenium RC is slower sinceit uses a Javascript program called Selenium Core.This Selenium Core is the one that directly controls the browser, not you.
Real-life Interaction :
- Other tools from Selenium suite like Selenium RC don’t communicate directly with the web browser. Client libraries (test scripts written in any programming language) communicate with Selenium Remote Control Server and Remote Control communicates with a Selenium Core (JavaScript Program) which in turn communicates with the web browser. Hence, this sort of twisted communication results as a hindrance on execution speed.
- WebDriver makes direct calls to the Web browser and the entire test script is executed in this fashion. WebDriver uses the browsers support and capabilities to automation.
WebDriver is faster than Selenium RC since it speaks directly to the browser uses the browser's own engine to control it.
Selenium RC is slower sinceit uses a Javascript program called Selenium Core.This Selenium Core is the one that directly controls the browser, not you.
Real-life Interaction :
- Other tools from Selenium suite like Selenium RC don’t communicate directly with the web browser. Client libraries (test scripts written in any programming language) communicate with Selenium Remote Control Server and Remote Control communicates with a Selenium Core (JavaScript Program) which in turn communicates with the web browser. Hence, this sort of twisted communication results as a hindrance on execution speed.
- WebDriver makes direct calls to the Web browser and the entire test script is executed in this fashion. WebDriver uses the browsers support and capabilities to automation.
- WebDriver interacts with page elements in a more realistic way. For example, if you have a disabled text box on a page you were testing, WebDriver really cannot enter any value in it just as how a real person cannot.
- Selenium Core, just like other Javascript codes, can access disabled elements .In the past, Selenium testers complain that Selenium Core was able to enter values to a disabled text box in their tests.Differences in API.
- Unlike Selenium RC, Selenium WebDriver doesn’t essentially require Selenium Server to be started before launching the test script execution. User can leverage the benefit and may or may not require Selenium Server if he/she desires to perform the test execution on the same machine where the browser is residing.
Exceptional Cases when Selenium Server is required with WebDriver:
- When the user wish to execute test scripts on the remote machine.
- When the user wish to execute test scripts on HtmlUnit Driver.
- When the user wish to execute test scripts on multiple platforms.
- WebDriver interacts with page elements in a more realistic way. For example, if you have a disabled text box on a page you were testing, WebDriver really cannot enter any value in it just as how a real person cannot.
- Selenium Core, just like other Javascript codes, can access disabled elements .In the past, Selenium testers complain that Selenium Core was able to enter values to a disabled text box in their tests.Differences in API.
- Unlike Selenium RC, Selenium WebDriver doesn’t essentially require Selenium Server to be started before launching the test script execution. User can leverage the benefit and may or may not require Selenium Server if he/she desires to perform the test execution on the same machine where the browser is residing.
Exceptional Cases when Selenium Server is required with WebDriver:
- When the user wish to execute test scripts on the remote machine.
- When the user wish to execute test scripts on HtmlUnit Driver.
- When the user wish to execute test scripts on multiple platforms.
API :
- Selenium RC's API is more matured but contains redundancies and often confusing commands. For example, most of the time, testers are confused whether to use type or typeKeys; or whether to use click, mouseDown, or mouseDownAt. Worse, different browsers interpret each of these commands in different ways too!
- WebDriver's API is simpler than Selenium RC's. It does not contain redundant and confusing commands.
-
WebDriver offers a wide range of solutions to some potential challenges in Automation Testing. It helps us to deal with complex types of web elements like checkboxes, dropdowns, and alerts with the help of dynamic finders.
With the advent of mobile era, WebDriver API has also matured and introduced some of the key technologies to enter this horizon. WebDriver enables user to perform web based mobile testing. It provides two of the essentials drivers to perform web based mobile testing.
- AndriodDriver
- IphoneDriver
Moreover, WebDriver API is fairly simple and easy. It doesn’t include repetitious commands. On the contrary, Selenium RC embodies many of the tautological commands.
WebDriver supports diverse range of web browsers and their versions. It supports all the conventional browsers in addition to some unique and rare browsers like HtmlUnit browser unlike Selenium RC and Selenium IDE.
- Selenium RC's API is more matured but contains redundancies and often confusing commands. For example, most of the time, testers are confused whether to use type or typeKeys; or whether to use click, mouseDown, or mouseDownAt. Worse, different browsers interpret each of these commands in different ways too!
- WebDriver's API is simpler than Selenium RC's. It does not contain redundant and confusing commands.
- WebDriver offers a wide range of solutions to some potential challenges in Automation Testing. It helps us to deal with complex types of web elements like checkboxes, dropdowns, and alerts with the help of dynamic finders.With the advent of mobile era, WebDriver API has also matured and introduced some of the key technologies to enter this horizon. WebDriver enables user to perform web based mobile testing. It provides two of the essentials drivers to perform web based mobile testing.
- AndriodDriver
- IphoneDriver
Moreover, WebDriver API is fairly simple and easy. It doesn’t include repetitious commands. On the contrary, Selenium RC embodies many of the tautological commands.
WebDriver supports diverse range of web browsers and their versions. It supports all the conventional browsers in addition to some unique and rare browsers like HtmlUnit browser unlike Selenium RC and Selenium IDE.
-
HtmlUnit Browser executes the test scripts analogous to other browsers except the fact that it runs in the headless mode i.e. GUI-less mode and the user won’t be able to view the test script execution. Said that the test script execution transpires in headless mode, thus the execution speed takes a roll and quickens the execution.
- HtmlUnit is termed as "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 your test execution cycles.Since it is invisible to the user, it can only be controlled through automated means.
- Selenium RC cannot support the headless HtmlUnit browser. It needs a real, visible browser to operate on.
-
WebDriver also supports web based mobile testing. Thus it provides AndroidDriver and IphoneDriver to back web based mobile testing.
Limitations of WebDriver :
- HtmlUnit Browser executes the test scripts analogous to other browsers except the fact that it runs in the headless mode i.e. GUI-less mode and the user won’t be able to view the test script execution. Said that the test script execution transpires in headless mode, thus the execution speed takes a roll and quickens the execution.
- HtmlUnit is termed as "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 your test execution cycles.Since it is invisible to the user, it can only be controlled through automated means.
- Selenium RC cannot support the headless HtmlUnit browser. It needs a real, visible browser to operate on.
- WebDriver also supports web based mobile testing. Thus it provides AndroidDriver and IphoneDriver to back web based mobile testing.
WebDriver Cannot Readily Support New Browsers :
Remember that WebDriver operates on the OS level. Also remember that 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, you have to give the WebDriver team quite some time to figure that new process out before they can implement it on the next WebDriver release.
However, it is up to the WebDriver's team of developers to decide if they should support the new browser or not.
Remember that WebDriver operates on the OS level. Also remember that 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, you have to give the WebDriver team quite some time to figure that new process out before they can implement it on the next WebDriver release.
However, it is up to the WebDriver's team of developers to decide if they should support the new browser or not.
Selenium RC Has Built-In Test Result Generator :
Selenium RC automatically generates an HTML file of test results. The format of the report was pre-set by RC itself. Take a look at an example of this report below.
WebDriver has no built-in command that automatically generates a Test Results File.
You would have to rely on your IDE's output window, or design the report yourself using the capabilities of your programming language and store it as text, html, etc.
Selenium RC automatically generates an HTML file of test results. The format of the report was pre-set by RC itself. Take a look at an example of this report below.
WebDriver has no built-in command that automatically generates a Test Results File.
You would have to rely on your IDE's output window, or design the report yourself using the capabilities of your programming language and store it as text, html, etc.
This comment has been removed by a blog administrator.
ReplyDelete