Site Loader
Auckland, New Zealand
Selenium as opposed to other automation testing tools doesn’t require installation, rather it require “Environment setup”, it means we just need to have following prerequisite before we start working with selenium. Prerequisite I am not going to tell you how you are going to install Java and Eclipse, since they are pretty straight forward. Let’s turn our attention on how we are going to use Selenium server jar file and client jar file we just downloaded. Once the Java is installed in your machine, Eclipse IDE is intelligent enough to identify the latest version of Java installed in your machine (Even if you have older version of Java, you can still select them). Step 1 Now let’s create a Java project and we call it as “SeleniumProject”. clip_image002[1] Click on the “Next” button in the New Java Project wizard and click on “Libraries” tab and click the “Add External Jars..” button clip_image004[1] Step 2 Remember the Selenium Client and Server Jar files we downloaded before? , we are going to use them now. While clicking on the “Add External Jars..” button, it ask as to add any jar files, here our Jar file of interest is “Selenium”, let’s start adding it. clip_image006[1] Select both the Jar files and click “Finish” button. Step 3 Congratulations!!! You have successfully created the Environment required for selenium. Now your eclipse IDE looks something like this clip_image008[1] Step 4 Let’s start creating a new Java class file and write a simple code using selenium to open a browser with URL of our www.executeautomation.com
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class OpenBrowser {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		WebDriver driver = new InternetExplorerDriver();
		driver.get("http://www.executeautomation.com");
	}

}
That’s it !! Happy Beginning Selenium !!!

Post Author: Karthik kk

Leave a Reply

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