Você está na página 1de 14

The Natural ari

The Natural ta
The Natural ver
The Natural tre

Selenium installation Guide

Selenium Remote Control

You can download the Selenium Remote Control from the website given below.


Latest version: Version 0.9.2

Steps to be followed

1. Unzip the folder to any specified location you want.

2. Go to the command prompt.

3. Type the command containing the path of the selenium server like

cd C:\seleniumRC\selenium-remote-control-0.9.2-dist\selenium- remote-
Press enter. (Give the path in which you have kept your selenium)

4. Then type java –jar selenium-server.jar –interactive
Press enter
This will start the selenium server with allowing the user to write commands
Entering interactive mode... type Selenium commands here (e.g.:

We can also give directly by specifying all commands in one go, instead of giving
it separately.
C:\>java -jar C:\seleniumRC\selenium-remote-control-0.9.2-
server.jar –interactive

5. Now you are ready to type your command. Like which I have given below
If IE then type this command on the selenium server screen (command prompt)

If you want to use Firefox, try this:

If all goes well, you should see a new browser window starting with the browser
of your choice. Back in the Selenium Server command window, you should see
the following message:
Got result: OK, 794468 on session 794468

NOTE: Each session will give different session ID and you have to replace the
session ID with your session ID.
This command will open the selenium test runner with the corresponding session
ID generated for that session.
The following window shows Selenium Test Runner.

If you want to do more then type the following commands to perform a google

When thie following command finishes, your browser window should

reveal google.com in the lower frame.

Then Type the below command for typing a search string in the search text box.

cmd=type&1=q&2=hello world&sessionId=794468

Now you can see that the “hello world” is displayed on the lower frame of the
browser , which is shown below.

In order to perform the search,we need to click the search
Buttom,for that type the following command.

The corresponding result is obtained in the lower frame of the browser.

The window is shown below.

In order to get the name of the browser,just type the following
command on the command prompt.

At any point of time, to shut down the server type control+c

Important Points:

 Make sure you have java installed in your system version 1.5 or above.
 If you get any port related error then try changing the port number.
E.g. port<new port number>
java -jar selenium-server.jar -port

 If you get an error saying something like this,


Could not proxy http://www.google.com/webhp
java.net.UnknownHostException: www.google.com
Powered by Jetty://
Then change the proxy settings or try without proxy.

For running Automation Scripts steps are given below.

1. Selenium RC
2. Jdk 1.5 or above
3. Junit or TestNG (I am using junit)
4. Set Class Path: Add Java class path, selenium class path and junit class path
Go to My Computer properties->advanced->Environment Variables-> System Variables

You will be having a class path variable, just need to add the new jar files to it.
1. Create a java file for running the simple Google search. You can record a Google test
through Selenium IDE and then export it to java.
Name the file as GoogleTest.java and save in any location.
2. Compile the java code through command prompt.
Command for complication
c:javapath/javac filename.java
Make sure that you are in the path where you have saved the java file

3. Then in another command prompt start selenium server using the command given in
step 3 to 4 in the steps to be followed.
Java –jar selenium-server.jar –interactive
4. Run the java file using the command java filename

This will start the selenium core and will perform the Google search (as per the
program is intended to do)

Selenium IDE

This is used for record and play back.

The installation is very simple.
You can download the Selenium IDE from the website given below.

Latest version: Version 0.8.7

Then go to the firefox

Toolbar->extensions click on that, a window will open just drag and drop the selenium
IDE to that window.

From that you can click on the selenium IDE, the window will appear on the screen.
Which is shown below.