Selenium WebDriver Java
1) Setup Java
- Download Java
- Install Java
- Set Java Environment Path
- Verify Java Installation
Before downloading the java open your command prompt and type java -version and see whether you have installed java or not. If you have installed java then you will see the following info in your command prompt.
If not you have to download the proper version of java from this link https://www.oracle.com/technetwork/java/javase/downloads/index.html. Try to install a new version of java.
Steps to Install Java
Once the download is complete, double click the file to begin the installation of JDK. This file will start the installation process. The installation process starts. Click Next button to continue the installation.
Steps to set the Java Environment Path
The Path Variable gives the location of executables like javac, java, etc. JDK’s programs (such as Java compiler javac.exe and Java runtime java.exe) reside in the sub-directory bin of the JDK installed directory. You need to include JDK’s bin in the path to run the JDK programs. Let’s see how to do it.
1) Right Click on the My Computer and select the Properties and select advanced system settings and click Environment Variables.
2) Click on the New button of User variables.
In case the path variable is already there, you can simply edit the same. For Newer Windows 10: You shall see a TABLE listing all the existing PATH entries (if not, go to the next step). Just add the new one for JDK as well. Steps to get the bin path are mentioned below.
3) Right-click on the address bar and Copy address as text of bin folder where the JDK is installed
4) Type PATH in the Variable Name. And then paste the path of bin folder in Variable Value. Click on OK button.
5) Go to Command Prompt and type java -version If you see a screen like below, Java is installed.