How to download selenium and install Selenium WebDriver with Eclipse and Java Step by Step
Downloading selenium WebDriver and installing Selenium WebDriver is easy.
- You need to download Selenium jar files.
- Then configure downloaded selenium jar files in eclipse.
- In fact, there is nothing to install except JDK.
- Let us discuss on the step by step process of download, installation and configuration of web driver software and other required components.
Steps to Setup and configure Selenium WebDriver With Eclipse and Java
Step 1: Download and install Java in your system
- First of all, you need to download and install JDK (Java development kit) software in your system.
- Go to: http://www.oracle.com/technetwork/java/javase/downloads/index.html
- And download JDK and install in your system.
Step 2: Download and install Eclipse
- Download Eclipse for Java Developers and extract to save it in your system/ in any drive.
- It is totally free. You can pick any version. Better version is: Eclipse Neon
- You can run ‘eclipse.exe’ directly and start working on it, so you do not need to install Eclipse in your system.
Step 3 : Download WebDriver Jar Files.
- Selenium WebDriver supports many languages and each language has its own client driver.
- Here we are the steps for configuring Selenium software with java so we need ‘webdriver Java client driver’.
- Click here to go on WebDriver Java client driver download page for WebDriver download file.
- On that page click on ‘Download’ link of java client driver as shown in bellow image.
- Downloaded ‘WebDriver Java client driver’ will be in zip format.
- Extract and save it in your system at some location/path (Like: D:\Automation\selenium-3.2.0.
- There will be ‘lib’ folder, jar files and change log in unzipped folder as shown in bellow figure.
- We will use all the jar files (from lib folder and outside lib folder) for configuring WebDriver in eclipse.
Step 4: Start Eclipse and configure it with selenium 2 (WebDriver)
- Double click on ‘eclipse.exe’ to start eclipse software application.
- First time when you start eclipse software application, it will ask you to select your workspace where your work will be stored as shown in bellow image.
- Create new folder in D: drive with name ‘Selenium_Automation’ and select it as your workspace.
- You can change it later from ‘Switch Workspace’ under ‘file’ menu of eclipse.
- After selecting workspace folder, Eclipse will be open.
- Create new project
- Create new java project from File > New > Project > Java Project and give your project name ‘FirstSeleniumProject’ as shown in bellow given figures.
- Click on finish button.
- Now your new created project ‘FirstSeleniumProject’ will display in eclipse project explorer as bellow.
- Create new package
- Right click on project name ‘FirstSeleniumProject’ and select New > Package.
- Give your package name = MyTestPackage and click on finish button.
- It will add new package with name ‘MyTestPackage’ under project name ‘FirstSeleniumProject’.
- Create New Class
- Right click on package MyTestPackage’ and select New > Class and set class name = ‘mytestclass’ and click on Finish button.
- It will add new class ‘mytestclass’ under package MyTestPackage’.
- Now your Eclipse window would look like bellow.
- Add external jar file to java build path
- Now you need to add selenium WebDriver’s jar files in to java build path.
- Right click on project FirstSeleniumProject > Select Properties > Select Java build path > Navigate to Libraries tab
- Click on add external JARs button > select both .jar files from the selenium extracted folder (Like: D:\selenium-3.2.0.)
- Click on add external JARs button > select all .jar files from D:\selenium-3.3.0\lib
- Now your FirstSeleniumProject properties dialogue will looks like bellow.
- That’s all about configuration of WebDriver software with eclipse.
- Now we are ready to write Selenium WebDriver tests in eclipse and run it.