Selenium Installation Guide
Selenium Installation Guide
The Natural ta
The Natural ver
The Natural tre
You can download the Selenium Remote Control from the website given below.
http://www.openqa.org/selenium-rc/download.action
Steps to be followed
3. Type the command containing the path of the selenium server like
cd C:\seleniumRC\selenium-remote-control-0.9.2-dist\selenium- remote-
control-0.9.2\selenium-server-0.9.2
Press enter. (Give the path in which you have kept your selenium)
1
4. Then type java –jar selenium-server.jar –interactive
Press enter
This will start the selenium server with allowing the user to write commands
like….
Entering interactive mode... type Selenium commands here (e.g.:
cmd=open&1=http://www.yahoo.com)
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-
dist\selenium-remote-control-0.9.2\selenium-server-0.9.2\selenium-
server.jar –interactive
2
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)
3
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.
4
If you want to do more then type the following commands to perform a google
search
cmd=open&1=http://www.google.com/webhp&sessionId=794468
5
Then Type the below command for typing a search string in the search text box.
cmd=type&1=q&2=hello world&sessionId=794468
6
Now you can see that the “hello world” is displayed on the lower frame of the
browser , which is shown below.
7
In order to perform the search,we need to click the search
Buttom,for that type the following command.
cmd=click&1=btnG&sessionId=794468
8
In order to get the name of the browser,just type the following
command on the command prompt.
cmd=getTitle&sessionId=794468
9
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
<a_free_port_number_like_4445>
You will be having a class path variable, just need to add the new jar files to it.
Steps
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
11
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
http://www.openqa.org/selenium-ide/download.action
12
Latest version: Version 0.8.7
From that you can click on the selenium IDE, the window will appear on the screen.
Which is shown below.
13
14