Selenium WebDriver Setup and Installation with Eclipse
In the previous tutorial, we introduced the basic architecture and features of WebDriver. This is the 9th tutorial in the Selenium Tutorial Training Series.
In this tutorial, we will discuss the installation procedure to get started with WebDriver initiating from scratch. We will also discuss the diverse range of drivers provided by WebDriver, each catering to different testing and environmental needs.
To use WebDriver for scripting, some prerequisites need to be in a place like the basic environment setup. In this series, we will use Java as a programming language within our sample examples. Thus, let us kick start with the Java installation.
Table of Contents:
Setting up and Installing WebDriver in Eclipse

Java Installation
Step #1: Go to Oracle’s official site – “JAVA download”, and download Java Platform, Standard Edition. All the recent releases are available on the page.

Step #2: As soon as you click on the Download button, the following screen will appear. Accept the License Agreement for Java installation and choose amongst the various cataloged Java Development Kit’s. Select the one that best suits your system configuration.

Remember to download JDK (Java development kit). The kit comes with a JRE (Java Runtime Environment). Thus, the user isn’t required to download and install the JRE separately.
Eclipse IDE Installation
Step #1: Go to Eclipse’s official website and navigate to its download page – Eclipse download. Download Eclipse IDE for Java EE developers. All the recent releases are available on the page.
Make sure you opt for and download the appropriate Eclipse IDE as per your system configuration. There are two download links available for the 64-bit Windows operating system and 32-bit Windows operating system.

Step #2: As soon as we click on the download link, the user is redirected to the fresh page securing information about the current download. Click on the download icon and you are done.

It may take a few minutes before you can download the complete zip folder.
Step #3: Once downloaded, copy the folder and place it in the desired location on your file system.

Step #4: Extract the zipped folder, a folder named Eclipse can be seen. The folder embodies all the required application and source files.

Step #5: Launch the Eclipse IDE using “eclipse.exe” residing inside the eclipse folder. Refer to the above illustration for the same.
Step #6: The application will prompt you to specify the workspace location. Workspace is the location where all your eclipse projects will be residing. Enter/Browse the desired location or the user can simply opt for the default location and click on the OK button.

Configuring WebDriver
As we will use Java as the programming language for this series and to create test scripts in Java, we would have to introduce language-specific client drivers. Thus, let us begin with the downloading of Selenium Java Client Libraries.
Download the Selenium Java Client Libraries
Step #1: Go to Selenium’s official website and navigate to its download page – “http://docs.seleniumhq.org/download/”. Refer to the section in the below illustration where you can find Client Libraries listed for distinct programming languages. Click on the download link for Java Client Library.

It may take a few minutes before you can download the complete zipped folder.
Step #2: Once downloaded, copy the folder and place it in the desired location on your file system.
Step #3: Extract the zipped folder, a folder named “Selenium-2.41.0.zip“ can be seen. The folder embodies all the required jar files which enable users to create test scripts in Java.
Thus, these libraries can be configured in Eclipse IDE.
Configuring Libraries with Eclipse IDE
Step #1: Navigate towards Eclipse IDE. Create a new Java-based project following File -> New -> Java Project. Refer to the following figure for the same.

Step #2: Provide a user-defined name for your Java Project. Let us provide the name as Learning_Selenium and Click on the Finish Button. The package explorer panel on the left side of the screen displays the newly created project.
Step #3: Create a new Java class named as “First_WebdriverClass” under the source folder by right-clicking on it and navigating to New -> class.
Step #4: Now let us configure the libraries into our Java project. For this, select the project and Right click on it. Select “Properties” within the listed options. The following screen appears. Select “Java Build Path” from the options.

Step #5: By default, the “Libraries” tab is opened. If not, click on the “Libraries” tab. Then, click on the “Add External Jars…” button. Browse to the location where we have saved the extracted folder for Java Client Libraries.
Step #6: Select all the JAR files present in the “selenium-java-2.41.0” folder and click on the open button within the dialogue box. The properties dialogue box should look like the below illustration.

Step #7: Click on the “OK” button within the dialogue box to complete the configuration part of the Selenium Libraries in our Java project.
The project will look like this:

Available Drivers
There are several driver classes available in WebDriver, each catering to a specific web browser. Each browser has a different driver implementation in WebDriver.
In WebDriver, a few of the browsers can be automated directly whereas some of the web browsers require an external entity to automate and execute the test script. This external entity is known as the Driver Server. Thus, the user is required to download the Driver Server for different web browsers.
Notice that there is a separate Driver Server for each of the web browsers and the user cannot use one Driver Server for web browsers other than the one it is designated for.
Below is the list of available web browsers and their corresponding Server Drivers.

Conclusion
In this tutorial, we accustom you to all the environment setup and installation to be done before the creation of WebDriver test scripts.
Here are the cruxes of this article:
- Prior to the creation of WebDriver-based test scripts, a few utilities and packages are required to be installed.
- Install JDK (Java Development Kit). Remember, the user is not supposed to install JRE separately because it is distributed bundled with the kit.
- Download Eclipse IDE. The user is only required to download the package and he/she is ready. No other installation is required with Eclipse.
- Download Java Client Libraries to create the test script in Java programming language.
- Launch eclipse using eclipse.exe. Select the workspace where you would want to save the projects.
- Create a new Java project in the eclipse. Create a new Java class within the project.
- Configure the eclipse by importing jar files for Java Client Drivers.
- In WebDriver, a few of the browsers can be automated directly whereas some of the web browsers require an external Driver Server.
- Firefox and HTML Units are the only browsers that cannot be automated directly. Thus, they do not require any separate Driver Server. All other commonly known web browsers like Chrome, Safari, Internet Explorer, etc. require Driver Servers.
Next Tutorial #10 => Now that we are done with the entire setup and installation, in the next tutorial we will create our own WebDriver test script using Java.
A remark for the readers: While our next tutorial of the Selenium tutorials series is in processing mode, install the packages mentioned in this tutorial and the required utilities to get started. Most of the WebDriver related packages can be found at the Selenium’s official website.
Let us know if you face any issues in the installation process.
Was this helpful?
Thanks for your feedback!