Selenium server standalone example

Step 1: Download the selenium,

selenium-server-standalone-2.28.0.jar (31.5MB).

Step 2: Download the junit-4.3.1. jar,

Step 3: Open the command prompt and run as follows,

“java -jar selenium-server-standalone-2.28.0.jar”

Step 4: Open the eclipse and create the project, Step 5: Create the java project named “Selenium” and create the class named “”  and paste the below code,

import org.junit.Test;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;

public class JavadomainTest{

public void jdtesting() throws InterruptedException{

Selenium selenium = new DefaultSelenium("localhost",4444,"firefox","");
selenium.start(); //starting selenium instance"/");
selenium.close(); //to close the browser
selenium.stop(); //to stop selenium instance


 Step 6: Rightclick on the project -> Build path -> Configure build path -> Libraries -> Add external jars -> (browse the location of downloaded selenium and junit jar file) -> ok. Step 7: Right click on the project -> Run As -> Junit Test.


Mozilla firefox will open with and is typed automatically at the search box and click the search button. Then from the search result it will open page.

622 total views, 3 views today

Leave a Reply

Your email address will not be published. Required fields are marked *