Selenium Old


We should be able to launch the test runner easily via a URL (bookmarked) and see the result in the browser. We should be able launch the test from Eclipse and have it run in a headless environment.

Test dependency
Data Driven
Ability to use Selenium IDE to record the tests
Ability to generate unique data
Grouping of test cases
Custom place holders (externalize configuration and data)
Data driven tests - execute same test with multiple datasets.

Application Configuration, GUI Map, Data Map
UI Objects, SeleniumHelper, Util, Data Generator

Ability to label a test case as dependent on another test case.
Ability to run test cases using data driven testing.

We need something that allow users to manage test cases that were recorded by Selenium IDE. Ideally, this should be integrated into Selenium IDE itself. The user should be able to record test cases, store these test cases in common location under version control (subversion, maybe via TurtoiseSVN), be able to search for test cases by name or description. Ability to use a folder structure to group related test cases. Ability to specify that this test case depends on other test cases. On the server side, we should be able to checkout from subversion, scan this directory, organize these test cases according to test dependency order, execute these test cases in parallel using Selenium RC or WebDriver.

Selenium allows us to add our own custom commands.

Define application specific settings (application URL, browser)
Define UI elements map


Google Test Analytics:

There is a #selenium channel

Selenium is hosted on Google Code: which has an issue tracker:

selenium user group

Selenium is a framework to automate functional ( UI ) testing of web application. Selenium is maintained by, and I also maintain a separate branch at

What is data-driven testing?
How to get Selenium IDE integrated with Selenium RC?
Test Dependencies,d.cGU Data Driven Testing using Selenium & TestNG Part 1 of 4

Selenium has several components:

Selenium Core is the base component which consist of the execution loop, a library of commands, and can be extended by adding userExtensions=… parameter. Selenium Core is implemented in JavaScript.

Selenium RC is a Java-based server. It has a nice hook for launching browsers, terminating browsers. It listens on a TCP socket. There are client libraries for PHP, Perl, Java, etc. More on Selenium RC

Selenium IDE is plugin for Firefox. At of November 8th 2008, it is primarily a test recorder. It allows user to interactively record the test, and play back. Selenium IDE is still fairly limited, but it seems that more features are being added. I hope that some day it will integrate with source control so that test script and test data can all be seamlessly checked into source control, and therefore better support for sharing between testers. Selenium IDE also has a TestRunner mode, and it is the primary mode that we used. Being a plugin to Firefox, it allows us to overcome security restrictions. We can have multiple window opened each fetch page from different domain. We can start testing one domain, and switch to another domain. We can test iframe that load content from different domain. In our particular case, our application was tightly integrated with so our script need to have both window opened, and our application window opened at the same time.

Selenium HTA is for testing with Internet Explorer. It gives us ability to overcome some security restriction.

Selenium Grid is for running Selenium on a grid or a cloud of nodes (Amazon EC2)

Selenium and TestNG

To use javascript variable as an argument to selenium command:


Selenium Code

UI_Element is available in SeleniumIDE as a user extension.




If the id got changed from txt_Lgn to txt_Login, we only need to change this in one place. Sample UI Map file:

var myMap = new UIMap();
    name: 'SignInPage',
    description: 'My App Sign In Page',
    pathRegexp: '.*'
myMap.addElement('SignInPage', {
    name: 'UserNameTextBox',
    description: 'UserName Text box',
    locator: '...'

This file has to be created as a JavaScript file with the .js extension. Open SeleniumIDE, select Option -> Options. Under Selenium Core Extensions (user extension.js), browse the above UIMap.js file and click OK. Close SeleniumIDE and reopen it to get the UIMap activated.

How to use Seleinum with JUnit / TestNG for data driven testing?

  1. Launch Eclipse
  2. Create a new workspace if necessary (File -> Switch workspace -> Other. Click the Browse button and create a new folder)
  3. Create a new Java project (File -> New -> Project -> Java -> Java Project)
  4. Create a new lib folder to contain all JAR files

Download selenium-server, selenium-java, -client, -driver from
Download TestNG from
Download jxl
Download JUnit

TestNG plugin for eclipse

Right click on the project -> Properties -> Java Build Path -> Add JARs

Create a folder name "tests" which is a source folder.
Create a package

Add test data files

Create a folder where we can keep all test data files. We can call this folder "resources/data"
Create a test data file (excel file)

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License