Selenium webdriver is a component of selenium testing suite which replace Selenium RC in the latest version of Selenium. Selenium webdriver does not need a server to communicate with the web browser and hence the time for testing is very much lesser than that is required while testing with Selenium RC. This tutorial will help you to learn how to download and install Selenium webdriver and also how to incorporate it with Eclipse IDE.
Let us discuss the entire process step by step.
The first step is to download and install Java on your system. Java Software Development Kit or JDK can be downloaded from the following link
As JDK is coming along with Java Runtime Environment or JRE, you do not need to download it separately.
Installing Eclipse IDE is the second step in the process. Eclipse IDE for Java developers can be downloaded from the below-given link.
Make sure that you have selected the right version for Windows 32 bit and 64 bit. From the link, you can download an exe.file named “eclipse-inst-win64” and double click on it for installing. Once you double clicked a new window will get open and select “Eclipse for Java developers” there.
When you select the “Eclipse for Java developers” option a new window will be opened. Click on the button near to “Installation folder” and change path to “C:\eclipse”. Now you can click on the “Install” button and once the installation is over another new window will be opened where you should click on the “Launch” button. Now the Eclipse neon IDE will get started.
Downloading Selenium Java client driver is the next step. That can be done from the below-given link.
There you will find the client drivers for other languages also but choose only the client driver for java. This will come as a zip file named “Selenium 2.25.0 – zip” extract it to your C drive and now you will get a library named “C:\selenium-2.25.0\”. This library contains all JAR files that can be imported to Eclipse later.
The fourth step is meant to configure Eclipse IDE with Selenium webdriver. In this step, first, the eclipse exe file inside the eclipse folder which has been extracted in step 2 should be launched first. When you launch it, the location should be mentioned and you can go with the default location.
Now you should create a new project by going to “File: -> “New”-> “Java Project” and name the project as “New Project”. Now a new popup window will appear and provide the following information in the concerned areas.
- Project Name
- Location for saving the project
- Select an execution JRE
- Select layout project option
Now you should click on “Finish” button. Now right click on the newly created project and go to “New”-> “Package” and name the package as “New Package” by entering the name in the pop-up window appears and then clicking on “Finish” button.
Now create a new Java class under the new package and name it as “My Class”. Now you have to do the following steps for adding JAR files.
- Right-click on “new project” and select Properties.
- On the Properties dialog, click on “Java Build Path”.
- Click on the Libraries tab, and then
- Click on “Add External JARs..”
Now another popup window will get opened. Select the JAR files you needed and click “Ok”.
Now you may add all the JAR files inside and outside of “libs” folder and click OK. Now the selenium libraries have imported to the project.