Getting started with Selenium WebDriver, Java and Eclipse IDE

In this blogpost, we will learn how to setup Selenium WebDriver with Eclipse IDE and Java and run the simple automation script.

Step 1 : Installing JDK (Java Development Kit) in the system. 

In this step, we will focus on installation of JDK in the system.

(Note : If you have JDK already installed in your system, jump to Step 2).

Visit to download JDK.


Click on Java Download button.



Accept the Licence Agreement and download jdk version which suits your platform.

And the JDK setup will start downloading. Once it gets downloaded, complete the installation.

Step 2 : Installing Eclipse IDE in your system.

Go to for downloading Eclipse IDE.


You can choose any of the Eclipse version from Release section(on left side bar).

We will download the Mars version of Eclipse, so click on Mars Packages from the Releases menu.

And now you can choose the Eclipse IDE for Java EE Developers as per your system configuration from the right side of the page (Windows 32-bit or 64-bit)


Click on DOWNLOAD button.

That’s it. Your system is now ready to develop and run simple Java application.

Step 3 : Downloading Selenium WebDriver JAR files.

Go to to download Selenium client bindings for Java.


Download Java Language binding (Version 2.53.0) or whichever is the latest.

The ZIP, containing all the JARs will be downloaded.

Step 4 : Moving JRE folder into Eclipse directory.

Now, after installing JDK and installing Eclipse and Selenium client bindings, before starting Eclipse, we need to move the JRE folder into Eclipse directory.

Go to the folder where you have installed JDK(C:\Program Files\Java).

Copy jre folder.

Paste the folder in Eclipse directory.  (C:\Program Files\eclipse).

Step 5: Configuring Eclipse workspace.

Go to Eclipse directory.

Double click on Eclipse.exe to launch Eclipse IDE.

Choose/ Browse the Workspace (The location where all the projects will be saved.) and Click OK button.

Step 6: Creating a simple project in Eclipse.

Now, it’s time to create a project in Eclipse.

Create a new project from File -> New -> Java Project.


Give Project name, Select JRE version and click Finish button.


The Java project will be created in Eclipse.


Now,  you need to add Selenium JARs to the build path of the project.

Right click on Project (in package explorer) -> Build path -> Configure build path.


Click on Add External JARs button.


Select all JAR files from downloaded zip file of Selenium bindings. Don’t forget to add JARs from lib folder. After adding all JARs, the libraries tab will look like this:


Click Ok button. And hurrah, we are ready to write our first Selenium script. 🙂

Step 7: Creating simple Selenium script.

Right click on the src folder of project, and create a new class named SeleniumFirstScript.

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class SeleniumFirstScript {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();

Run the program and you will get the title of Webpage in console.

Hope it helps you 🙂

Cheers 🙂