Selenium RC - Installation Procedure

Step by Step process for Selenium RC Installation:-

1) Install Java:
Selenium RC requires us to install JDK in machine. Download JDK and Install it.
Set or change the PATH system variable.
For Windows XP:
Start -> Control Panel -> System -> Advanced
Click on Environment Variables, under System Variables, find PATH, and click on it.
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If
you do not have the item PATH, you may select to add a new variable and add PATH as the
name and the location of the class as the value.
(Example: C:\Program Files\Java\jdk1.6.0_23\bin;) Refer Screenshot.
Close the window.
For Windows Vista:
Right click “My Computer” icon
Choose “Properties” from context menu
Click “Advanced” tab (“Advanced system settings” link in Vista)
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If
you do not have the item PATH, you may select to add a new variable and add PATH as the
name and the location of the class as the value.
Close the window.

2) Install "Eclipse IDE for Java Developers" (Eclipse Indigo)
Download Eclipse from given URL:
(Just click on the Green Download Icon)

3) Install "TestNG"
Open Eclipse and create a work space.
Go to Help -> Install new software -> Add -> Name = TestNG and Location =
http://beust.com/eclipse -> OK -> Select TestNG check box in below frame -> Next -> Next ->
Accept the agreement -> Finish.
Restart Eclipse.

4) Download required JARs
Download junit-4.8.2.jar from https://github.com/KentBeck/junit/downloads
Download selenium-java-2.4.0.jar from

5) Create New Project
File -> New -> Other -> JAVA (expand) -> JAVA PROJECT -> Next -> Project Name
(“project_name”) -> In below “JRE section” select (Use a project specific JRE:) -> select JDK ->
Finish.
Right click on Project Name (“project_name”) -> New -> Package -> Name (Package_Name) ->
Finish.
Right click on (Package_Name) -> New -> Other -> TestNG (expand) -> TestNG class -> Next -
> Class name (samplejava) -> Check @Testbefore and @After -> Finish.
Right click on “samplejava.java” -> Build Path -> Configure Build Path -> in Java Build Path
section -> Add External JARs -> Add junit-4.8.2.jar -> Add External JARs -> Add seleniumjava-
2.4.0.jar -> Add External JARs -> Add selenium-server-standalone-2.4.0.jar -> OK.

6) Sample Test Script - samplejava.java
package packagename;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
import com.thoughtworks.selenium.*;
import org.openqa.selenium.server.*;
public class samplejava
{
public Selenium selenium;
public SeleniumServer seleniumserver;
@Test
public void fo()
{
selenium.open("http://facebook.com/"); //load development
URL
selenium.waitForPageToLoad("30000");
}
@BeforeTest
public void beforeTest()
{
try
{
seleniumserver = new SeleniumServer();
selenium = new DefaultSelenium("localhost", 4444,
"*firefox"/* *safari, *ieexplorer, *googlechrome */,"http://");
seleniumserver.start();
selenium.start();
}
catch (Exception e)
{
e.printStackTrace();
}
}
@AfterTest
public void afterTest()
{
selenium.stop();
seleniumserver.stop();
}
}

7) How to Run Test
Right click on the samplejava.java -> Run As -> TestNG Test.
After executing the script we can show the TestNG Report.

Comments

Popular posts from this blog

Online Selenium Training With Real Time Scenario

Online Tricentis Tosca Automation Training with Real Time Scenarios

Online Training for Manual/Functional