Before Installing Selenium WebDriver, you should have Java and Eclipse installed in your computer system. So the first thing we need to do here is download and install Java Development Kit in your local system.
Steps To Download and Install Java
The first step is to download and install Java on your computer system. Here are the steps to download and install Java on your computer system:
- Go to google and search for “Download Java” and in the search results click on the second link.
2. Once you go to that link, you will get the following page. Click on the highlighted option.
3. After clicking on the above mentioned option you have to click on the License Agreement.
4. After accepting the License Agreement, you need to select the correct file to download.
Once you have downloaded Java in your local system, install it. The next thing you need to do is download and Install Eclipse in your local system.
Steps to Download and Install Eclipse
1. Go to http://www.eclipse.org/downloads/.
2. As per your system configuration, you can select the type of download you want.
3. Once you download, you will be able to see a zip file, inside that zip file there will be an Eclipse folder. Extract and install it.
The next step you need to do is Download the Selenium Java Client Driver.
Steps To Download Selenium Java Client Driver
1. Go to the link http://docs.seleniumhq.org/download/.
2. Click on the download link to download all the jar files. You will get the client drivers for all the languages here but you need to download the one for java.
3 . Once you download, you will get a folder containing two jar files. There will be a lib folder under which you will get a jar file and another one is CHANGELOG file.
Once you have every required thing installed in your computer system, the next thing you have to do is you need to configure Eclipse IDE with WebDriver.
Steps To Configure Eclipse IDE with WebDriver
- Go to Eclipse Folder in your computer system. There you will get “eclipse.exe” file, click on this file.
- Now it may ask you to enter a workspace. You can change the default workspace and can create your own workspace in any drive and can give the path here.
File Menu -> New -> Java Project -> Name of the Project (Keep it as “test”) and click on Finish.
4 . Go to File Menu -> New -> Class and name the class as “test” and check on the checkbox “Public static void main(String args) and click on Fininsh.
5 . Right click on the project “test” and select “Properties”.
6 . After Selecting “Properties”, select “Java Build Path” option.
7 . Click on “Libraries” tab and then click on “Add External Jars”.
8 . Now navigate to the path where you have saved your extracted selenium zip file.
9 . Select all the Jars file inside and outside the “libs” folder and add it .
10. Now you can click on OK. Here you have completed importing your selenium libraries into your project. You can start coding now.. 😀