You are on page 1of 4

WORKING WITH SELENIUM

SELENIUM

Selenium is the tool for functional and regression testing Having 3 Parts

Selenium IDE

It’s a java script framework. It is installed as addon on mozilla It is used to record user steps on application. Selenium RC

It is mainly used to run test suites on multiple browser. Selenium GRID + multiple systems.

Commands used in selenium are called Selenese

First, we will describe how the components of Selenium RC operate and the role each plays in running your test scripts.

RC Components

Selenium RC components are:

The Selenium Server launches and kills browsers

interprets and runs the Selenese commands passed from the test program

acts as an HTTP proxy, intercepting and verifying HTTP messages passed between

the browser and the AUT. Return result of selenium command back to test program. Selenium server is bundled with selenium core, automatically inject this selenium core to browser when start browser.

Selenium-Core is a JavaScript program, actually a set of JavaScript functions which interprets and executes Selenese commands using the browser’s built-in JavaScript interpreter.

Client libraries which provide the interface between each programming language and the Selenium RC Server.

*

Client libraries provide support of different language to selenium

Here is a simplified architecture diagram ....

Here is a simplified architecture diagram .... The diagram shows the client libraries communicate with the

The diagram shows the client libraries communicate with the Server passing each Selenium command for execution. Then the server passes the Selenium command to the browser using Selenium-Core JavaScript commands. The browser, using its JavaScript interpreter, executes the Selenium command. This runs the Selenese action or verification you specified in your test script.

HOW TO CREATE A BAT FILE TO START SELENIUM SERVER

1-> Open a Notepad 2-> Enter following commands

ECHO "HELLO WORLD" PAUSE

// To display something on console // Hold Execution until user press Enter

cd D:\ PAUSE Cd Program Files\Java\jdk1.6.0\bin\Selenium\ PAUSE Java -jar Selenium-server.jar

3-> Save File as Name.bat file

What is Web Driver

New Enhancement to Selenium 2.0. We need not to start selenium Server Interact with Browser Directly(Not using Java Core etc) Support HTML Dom as well, so we can work on multiple elements together. HtmlUnitDriver:- is much faster because it run test case in memory not in physical. We have Native Drivers for each Browser sp we need to make implements separately for each driver.

Advantage :Fast No need to use selenium server.

Disadvantage : Need to implement native driver for each browser Give support to only few browsers till now.

HOW TO WORK WITH SELENIUM GRID

Selenium Grid is the part of selenium test suite, which is used to distribute selenium test cases on multiple browser and multiple machine with the help of that we can run multiple test cases in parallel.

Selenium Grid has 2 controls selenium Hub and Selenium RC, selenium hub takes request from different tests(as RC do in normal condition) and then allocate remote control that are registered to the hub.(1 RC to 1 test request)