Selenium Web Driver


Selenium Web Driver Tutorial
Introduction to Web Driver & Comparison with Selenium RC:


Already you have learned to create simple tests in selenium IDE, now we must  Create more
powerful using an advanced tool that is known as Web Driver.


What is Web Driver?

It is a web automation framework that permits you to execute your tests against  Different
browsers like opera, Mozilla, google chrome, ext...(Rather selenium IDE).




Web Driver also permits you to use a programming language to create your test
Scripts (not possible in Selenium IDE)


1. Now you can use conditional operations like if-then-else or switch-case.

2. You can also perform looping like do-while.


Following programming languages are supports by Web Driver:


Java

.Net

PHP

Python

Perl

Ruby


You no need to know all them. you need Knowledgeable in one. In this tutorial,
We will be using Java with Eclipse as our IDE.


Web Driver Vs Selenium RC:


We have another tool that is selenium RC. It is discovered before WebDriver comes in 2005.

Web Driver and Selenium RC have following features:


1. Both of these permit you to use a programming language in designing your test scripts.

2. They both allow you to run your tests against different browsers.


So how do they differ? Let us discuss:



Web Driver architecture is simpler than Selenium RC.


1. It controls the browser from the OS level

2. you need are you program language's (which contain selenium commands) and browsers.

Selenium RC's architecture is way more complicated.



1. First, you need to apply a separate application for Selenium Remote Control (RC).
   Server before  You can start testing.

2. Acts as a "middleman" between your Selenium commands and your browser.

3. When you start the testing, Selenium RC. The server brings a JavaScript program
   called Selenium Core into the browser.

4. Once bring, Selenium Core will start receiving instructions relayed by the RC.
   Server from your test program.

5. When the instructions are received, Selenium Core will execute them as JavaScript commands.

6. The browser will agree on the instructions of Selenium Core. And will relay its response to the RC Server.

7. Once RC Server will receive the response of the browser and then display the results to you.

8. RC Server will get the next instruction from your test script to repeat the whole cycle.


Speed:


WebDriver is faster than selenium RC. It interacts with browser engine in the single step.
Selenium RC is slower since it uses a JavaScript program known as Selenium Core. This Selenium Core
is the one that  controls the browser, not you.


Real interaction:


In Web Driver, it can interact with the browser.



But in Selenium RC do not interact with the browser. Selenium Core, like other JavaScript codes,


Can access disabled elements


Limitations of Web Driver:


1. WebDriver Cannot Support New Browsers

2. It operates on the OS level.

3. Different browsers are communicating with OS in different ways.

4. It communicating process is also different compared to other browsers.


Selenium RC generates an HTML file of test results. The format of the report  Was pre-set by RC itself


Web Driver has no built-in command that generates a Test Results File.
You would have to rely on your IDE's output window.

Using the capabilities of your programming language and store it as text, HTML, etc.

Share this

Related Posts

Previous
Next Post »