How to configure Selenium RC with JUnit using Eclipse?


How to configure Selenium RC with JUnit using Eclipse?


Here, we’ll discuss how to set up and configure Eclipse to use it for the java version of selenium RC. So prior to set up, make sure you have all the following required components gathered and the latest version of java installed in our system. 




The components required are as below.

1. Install JRE : http://www.java.com/en/download/
2. Download Eclipse IDE for Java Developers :
http://www.eclipse.org/downloads/
3. Download Latest version of JUnit:
https://github.com/KentBeck/junit/downloads
4. Download and Install Selenium IDE firefox plugin : http://seleniumhq.org/download/
5. Download Selenium RC server and Selenium Client Drivers for Java:
http://seleniumhq.org/download/

Step 1 : Extract Eclipse
No need to install Eclipse. Just Extract the eclipse package to your preferred location.

How to configure Selenium RC with JUnit using Eclipse?


Step 2 : Extract Selenium RC and Selenium Client Drivers
Extract the Selenium RC and Selenium Client Drivers zip files to your preferred location. Create “Selenium” folder in D: drive (i.e. D:\Selenium) and In this “Selenium” folder, copy the selenium-server.jar as well as unzip the Selenium Client Java driver.

How to configure Selenium RC with JUnit using Eclipse?


Step 3 : Launch and Configure Eclipse
After launching eclipse, a prompt appears to use a workspace. A custom workspace can be created using the browse button and creating a new folder. Name that new folder for convenience (i.e. D:\Selenium with JUnit) and select the same and click OK. Now you will be navigated to the home screen of Eclipse. There, we need to click on workbench which will take us to the work area.

How to configure Selenium RC with JUnit using Eclipse?


Step 4 : Create new Project
We need to create a project which will contain our scripts. To do so, Go to Eclipse > Click File > New > Project. and In Select a Wizard > Click Java > Java Project. Once you click on the Java Project, a pop up window appears to set the parameters of your project. Provide the name of the project in Project Name field and make sure it uses the latest execution environment. Click on Finish button and the project is created. Once the Project is created you will see it in package explorer on the left side. By expanding the project the there will be one default “src” folder created and it will have the JRE system library files associated to the project.
 
How to configure Selenium RC with JUnit using Eclipse?
 

Step 5 : Configure the Selenium Client driver to this Project
Right Click on created project in package explorer and select Build Path > Configure Build Path. Once you click the same one pop up window comes up. Now in this pop up window, Click Libraries tab and Click “Add External JARs” button. Select “Selenium Client Drivers” unzipped in “D:\Selenium” folder (Selenium Server JAR file should not be added) and Click on OK button. Now the build path is configured and the project is ready to be used.

How to configure Selenium RC with JUnit using Eclipse?


Step 6 : Create one Package.
Right Click on “src” in package explorer and select New > Other... > Java > Package. Once you click on the Next button, a pop up window appears to create a new Java package. Provide the name of the package in Name field. Click on Finish button and the package is created. Once the Package is created you will see it in package explorer on the left side.

How to configure Selenium RC with JUnit using Eclipse?
 

Step 7 : Add a Class file.
Right Click on “Package” in package explorer and select New > Other... > Java > Class. Once you click on the Next button, a pop up window appears to create a new Java class. Provide the name of the class in Name field. Click on Finish button and the .java file is created.

How to configure Selenium RC with JUnit using Eclipse?

 
After executing all above steps, your final package explorer should look as below.

How to configure Selenium RC with JUnit using Eclipse?












Thanks and Regards,
Prashant Vadher | QC Engineer 

1 Comments:

onlinearticlessubmission.com said...

Nice presentation. Please share all steps in video so that we can understand it better.

Post a Comment

 
Design by Prashant Vadher