of 12
8/6/2019 How to Selenium RC
1/12
ContentsContents ..................................................................................................................... 1
Requirements:............................................................................................................ 2How to run? ................................................................................................................ 3
Back-End Testing ...................................................................................................... 10
Test Input Data ......................................................................................................... 11
8/6/2019 How to Selenium RC
2/12
Requirements:Download the below tools that you have to configure on your system.
JDK 6
o URL: http://java.sun.com/javase/downloads/index.jsp
o Go to the above URL and get the JDK 6 which includesJRE andJUnit
that is required to run the project.
o After downloading install JDK.
Eclipse Classic Used for script development
o URL: http://www.eclipse.org/downloads/
o Go to above URL and download the Eclipse Classic. You can download
its latest version.
o After download, extract the ZIP file to directory of your system.
Selenium Remote Control
o URL: http://selenium-rc.openqa.org/
o You have to go above URL and download the selenium-remote-
control-1.0.1-dist.zip version of the selenium remote control.
o After download it, extract the ZIP file to the directory of your localsystem.
Apache POI Java API to Access Microsoft Format Files
o I attached the POI-3.0.2-FINAL.jar file with the email; you can also
download it from official site of Apache.
o Get this file form mail attachment and store on your system.
Internet Browser Firefox or Internet Explorer
o You can run these scripts either on Internet Explorer or Firefox.
Microsoft Office 2007
o Microsoft Office must be residing on your system so that you can edit
the InputData.xls file that is used for test input data during test
execution.
http://java.sun.com/javase/downloads/index.jsphttp://www.eclipse.org/downloads/http://selenium-rc.openqa.org/http://java.sun.com/javase/downloads/index.jsphttp://www.eclipse.org/downloads/http://selenium-rc.openqa.org/8/6/2019 How to Selenium RC
3/12
8/6/2019 How to Selenium RC
4/12
5. Run the Eclipse.
Go to File menu and click Import...
Select Existing Projects into Workspace and click Next button.
8/6/2019 How to Selenium RC
5/12
Click Browse button and then go to the targeted directory ofConsole and
press OKbutton.
Click Finish button.
8/6/2019 How to Selenium RC
6/12
The project is imported to the workspace of eclipse and now if you see some
errors in project files then Right-Click on package of the project and click
Build Path and then Configure Build Path.
Click Add External JARs and locate jar files ofselenium-java-client-
driver.jar and poi-3.0.2-FINAL.jar
You can also importJUnit manually, if you got some errors related to
TestCase. (junit.framework.TestCase)
After adding external jar files, the project is ready to execute which will
automate the written test scenarios.
8/6/2019 How to Selenium RC
7/12
Before run the project, make sure that:
VPN is connected
Selenium Server is running
Firefox 2.0.* is installed
Microsoft Office 2007 is installed
6. To execute a single file, right-click in file and click Run As -> JUnit Test as
shown below.
After clickingJUnit Test, the test case will start its execution and new
browser will be opened automatically.
8/6/2019 How to Selenium RC
8/12
After completed its execution the status of the test case can be view in
eclipse onJUnit panel that is available with the Package Explorer panel.
7. If you run the AllTest.java then it will execute all the test cases in this file
and will show the results inJUnit panel as below.
8/6/2019 How to Selenium RC
9/12
8/6/2019 How to Selenium RC
10/12
Back-End TestingThese scripts also perform Back-End (Database Testing), for mopconsole and
staging databases. I implement this functionality by making connection to
database through JDBC and get intended value by SQL query statement and
then insert assertion for the verification of correct database.
8/6/2019 How to Selenium RC
11/12
Test Input DataInputData.xls is the file that is used for test data at test case execution time.
Example:
If we run the test case for adding user then the parameters for this testcase will be get from this excel sheet and place in their relevant text
boxes on the console.
Current Date/Time of the system is append automatically to different
parameters (which came from this excel file) during the test execution time
to minimize the manual changes in the excel sheet. For that now, whether
you have to run a single test case, multiple test cases or the whole test suite
at once, you must have to run through AllTests.java file, otherwise some
errors will throw in the test case.
8/6/2019 How to Selenium RC
12/12