Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
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
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)
2
cmd=getNewBrowserSession&1=*firefox&2=http://www.google.com
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.
3
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
4
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
5
Now you can see that the “hello world” is displayed on the lower frame of the
browser , which is shown below.
6
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
7
In order to get the name of the browser,just type the following
command on the command prompt.
cmd=getTitle&sessionId=794468
8
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
10
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
11
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.
12
13