Download and Install Selenium Webdriver and Java

28 February, 2012
Its very easy to download and set up Selenium WebDriver. Only Java JDK needs installation. Selenium WebDriver does not need any installation. Please find below the steps to download, installation and configuration of WebDriver and other required components.

Step 1 : Install Java on your system

Download and install the Java Software Development Kit (JDK). Click here to download.

The JDK version comes bundled with Java Runtime Environment (JRE), you do not need to download and install the JRE separately.

Step 2 : Install Eclipse IDE

Download "Eclipse IDE for Java Developers" here. Choose Windows 32 Bit and 64 Bit versions depending on your system.

Step 3 - Download the Selenium Java Client Driver

Download the Selenium Java Client Driver here. You will find client drivers for other languages there, but only choose the one for Java.


This downloads the file "selenium-2.41.0.zip". Extract the contents of this ZIP file on your C drive so that you would have the directory "C:\selenium-2.41.0\" (or any other location of your choice). The unzipped directory contains all the JAR files that we would later import on Eclipse.

Step 4 - Configure Eclipse IDE with WebDriver


1. Launch the "eclipse.exe" file inside the "eclipse" folder.
2. Create a new project through File > New > Java Project.
3. Right-click on the project created in the above step and select New > Package. Name the package.
4. Create a new Java class under the package created above by right-clicking on it and then selecting New > Class. Give a name to the class.
5. Right-click on the project and select Properties.
6. On the Properties dialog, click on "Java Build Path".
7. Click on the Libraries tab, and then click "Add External JARs.."
8. Navigate to C:\selenium-2.41.0\ (or any other location where the extracted contents of "selenium-2.41.0.zip" are saved).
9. Add all the JAR files inside and outside the "libs" folder. Your Properties dialog should now look similar to the image below.


10. Click OK and we are done importing Selenium libraries into our project.


Different Drivers

HTMLUnit and Firefox are two browsers that WebDriver can directly automate without any other separate component. For other browsers, a separate program is needed which is known as the Driver Server.

A driver server is different for each browser. For example, Chrome has its own driver server which you cannot use on other browsers. You can download these driver servers here for the corresponding browsers you are using.

No comments:

Post a Comment