Download and Install Selenium Webdriver with Eclipse and Java Step By Step

Step 1 : Download and install Java in your system

First of all you need to install JDK (Java development kit) in your system. To download java Click here and install it in your system.

java.png  1346×553

Step 2 : Download and install Eclipse

Download Eclipse and save it in any drive. It’s free.

java1.png  1346×553

Step 3 : Download WebDriver Jar Files.

Selenium WebDriver supports many languages and each language has its own client driver. Here we are configuring selenium 2.0 with Java so we need ‘Webdriver Java client driver’. Click here for WebDriver download file. On that page click on ‘Download’ link of java client driver as shown.

java2.png  1346×553

Extract and save it in your system in any Drive. There will be ‘libs’ folder, 2 jar files and change log in unzipped folder. We will use all these files for configuring WebDriver in eclipse as shown.

java3.png  1346×553

Step 4 : Start Eclipse and configure it with selenium 2 (WebDriver)

  • Select WorkSpace on eclipse start up

Double click on ‘eclipse.exe’ to start eclipse. Create new folder in a drive with name ‘workspace’ and select it as your Workspace  where your work will be stored and click Ok as shown.

wc.png  1346×553

Now Eclipse will open

  • Create new Project 

Create new java project from File > New > Project > Double click Java Project and give your project name ‘testproject’ as shown.

jav.png  1346×553

Click on ‘Finish’ Button.

Untitled

Created project ‘testproject’ will be shown on eclipse

3.png  1346×553

  •  Create new Package

Right click on ‘testproject’ and select New > Package.

4.png  1346×553

Give your package name ‘testpackage’ and click ‘Finish’ as shown.

5.png  1346×553

  • Create new Class

Right click on ‘testpackage’ and select New > Class.

6.png  1346×553

Give your class name ‘TestClass’ and click ‘Finish’ as shown.

7.png  1346×553

Your Eclipse window will look like as shown.

81.png  1346×553

  • Add External jar files to Java build path

 – Right click on project ‘testproject’ > Select Properties > Select Java build path > Navigate to Libraries tab.
Click on Add external JARs button > select both .jar files from the folder in the drive.
Click on add external JARs button > select all .jar files from the folder in the drive.

Your ‘testproject’ properties dialog will be shown as below

91.png  1346×553

Next be ready to write your first WebDriver Script with Eclipse. Let’s get started !!

Leave a comment