In this article you will learn how to install Selenium WebDriver (java only) and configure Eclipse.

STEP 1 – Download and Install Java Software Development Kit (JDK)

Download the Java Software Development Kit (JDK) from here and install it. Make sure you choose correct JDK version based on your OS. This JDK kit will have Java Runtime Engine (JRE) bundled in it. It is easy to install, just accept the default settings.image[6]

STEP 2 – Download the Eclipse IDE

Download “”the “Eclipse IDE for Java Developers” using this link. Choose the correct Windows OS  32 bit or 64 bit version.

image_thumb.png

The downloaded zip file would look like

image.png

Extract the ZIP file, it will contain the eclipse folder with all application files. Installation is not required to use it.

STEP 3 – Download the Selenium Java Client Driver

Download the Selenium Java Client Driver using this link. It will have Client drivers for other languages like C#, Python etc. you can download just the Java Client Driver.image[22]The downloaded ZIP file will look like

image[26]

Extract the content into some folder, later the contents will be imported into Eclipse.

STEP 4 – Configure Eclipse IDE with Selenium WebDriver

– Launch the ‘Eclipse.exe’ executable from the folder Eclipse which was created in Step 2.

– It will ask to select for a workspace, select defaults and click OK.

image[31]

The GUI will appear like this-

image[36]

-Create New project using Menu File—>New –> Java Project. Name the project as Test_Project.

-Now create a package under the newly created project by right clicking on the ‘Test_Project’ and select New –> Package. Name the package as ‘Test_Package’. Keep the defaults for rest of settings.

-Create new Java class under Test_Package by right clicking on it and then select New –> Class. Name the class as “testClass’’. The Project, package and the class will appear like this in IDE-

image[40]

-Now right-click on test_project and select Properties.
-On the Properties dialog, click on “Java Build Path” and select Libraries tab.
-Then click “Add External JARs..”
-Navigate to path where you extracted contents of “selenium-2.25.0.zip” in step 3.
-Add all the JAR files inside and outside the “libs” folder. Click OK and importing of Selenium library files into your project is completed.

WebDriver can directly automate Firefox driver. For other browsers like Chrome and IE, a separate program is needed called the Driver Server. A driver server is different for each browser. You can download these driver servers using this Link.