User:Viki view

Selenium
Selenium is a framework that executes tests from within a browser using a combination of Javascript and DHTML.

It supports IE, Firefox and Mozilla, thus allowing browser compatibility testing.

There are three Selenium components:

•	Selenium Core; contains the main test runner.

•	Selenium RC (Remote Control); contains a server that can launch a browser automatically and trigger it to run a test suite.

•	Selenium IDE; an IDE and test recorder in the form of a Firefox extension.

Selenium IDE

Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests.

It includes the entire Selenium Core, allowing you to easily and quickly record and play back tests in the actual environment that they will run.

It is not only recording tool: it is a complete IDE. You can choose to use its recording capability, or you may edit your scripts by hand. With autocomplete support and the ability to move commands around quickly, Selenium IDE is the ideal environment for creating Selenium tests no matter what style of tests you prefer.

Features:

•	Easy record and playback

•	Intelligent field selection will use IDs, names, or XPath as needed

•	Autocomplete for all common Selenium commands

•	Walk through tests

•	Debug and set breakpoints

•	Save tests as HTML, Ruby scripts, or any other format

•	Support for Selenium user-extensions.js file

•	Option to automatically assert the title of every page

Types of Client Drivers: There are six types for client drivers which Selenium tool currently supports:

1. .NET(C#)

2. JAVA

3. Perl

4. Python

5. Ruby

6. PHP

You can use any of these languages to write scripts to test the web application. Along with the Client driver you need to start Selenium server in one thread. Make sure the thread is continuously running. (Selenium server comes along with the Selenium Remote control installation package)

Starting Selenium Server:

To run any type of script from the client driver, you have to make sure that the Selenium server is running in a separate thread.

To start Selenium sever just browse till the selenium server folder through DOS-PROMPT and on the command prompt just type the following command

C:\>java -jar selenium-server.jar

In the same window you will see some server logs.

Steps to create and execute a Do Net test script using Selenium RC.

1. Create a Dot Net test case in selenium IDE

2. You open Visual Studio and select a Window Application Project from the Visual C# node.

3. Replace the content of Program.cs file with the Dot Net Script.

4. Add needed references - the dll files are located in the corresponding C# folder in the Selenium Remote Control folder. (The files are located in the "selenium-dotnet-client-driver-0.9.2" folder.)

5. Create the main method in the code and call the following methods: SetupTest, Scripting method containing the action.

6. Build the solution.

7. Start the Selenium Server. And it should remain up and running throughout the process otherwise it would not run the Script.

Java –jar selenium-server.jar

8. Now run the project. Now Selenium RC IDE would get opened. There you can see the running script and Logs.

Steps for installing Java client driver:

1.	Install JDK 1.5

2.	Set the value of following variables in your system variables

•	JAVA_HOME=  •	CLASSPATH= •	Path =%JAVA_HOME%\bin

You will also need to add following 3 packages in your class path

1.	junit.jar

2.	selenium-server.jar

3.	com.jar

I have downloaded it, and attached it here, save it on your local machine and then add it in your class path. Now you have done with all hectic part :)

But please be alert as you are playing with System variables. From command prompt start your selenium server.

Once you have done this, you can run your java code which will use your selenium server as web server.

You will also need to add following 3 packages in your class path

4.	junit.jar.

5.	selenium-server.jar.

6.	com.jar.

I have downloaded it, and \\bhushanp\Pacakges required for java driver, save it on your local machine and then add it in your class path..

Now you have done with all hectic part :) But please be alert as you are playing with System variables. From command prompt start your selenium server..

Once you have done this, you can run your java code which will use your selenium server as web server..