How to install java and setup eclipse for Selenium web driver.

How to install java and setup eclipse for selenium web driver.

In this selenium web driver tutorial, We are going to discuss how to install java for selenium web driver there are some simple steps that you need to follow one by one and we are also going to cover how to download and set up eclipse for selenium web driver.

Configure Java development tools(JDK).

Before configuring JDK you need to understand what is JDK.

What is the Java Development Kit(JDK): 

JDK is used to develop the java application. It is a software development environment. It contains JRE a runtime environment for the java application. Javac file to compile the source code, Javadoc file for documentation lots of Jars which will help to develop a java application. Download the latest version of JDK from “Download JDK ”.

Just follow the instruction and Install JDK and to confirm just check c — >program files –> java

 To download Follow the below steps:

Visit official website http://www.oracle.com/technetwork/java/javase/downloads/index.html.

Install java for selenium web driver

Accept license or term and conditions.

Java environment for web automation

Choose a file according to your operating system.

Java environment for web automation

 NOTE: Simply install like other software you just need to double click on downloaded .exe file and follow the instructions carefully and confirm the installation.

Java environment for web automation

Selenium web driver setup with eclipse.

In this selenium web driver tutorial, We are going to discuss how to install Eclipse for selenium web driver before this you need to install java for selenium web driver in your system. there are lots of IDE available in the market to write the selenium scripts but if you want to write the script with java then I will recommend you to use eclipse. It has the great interface which will help to integrate the API or libraries.

Install Eclipse for selenium web driver.

Downloads Eclipse from the official website of Eclipse org https://www.eclipse.org/downloads/

 Note: If you are using window machine you need to check you are using 32bit or 64bit. Download the file according to your operating system or If you are using MAC machine or Linux machine you need to download Eclipse accordingly.

Download the latest version of eclipse for window machine.

 setup eclipse for selenium web driver

After download extracts the Zip file and open eclipse folder and Run the application by click on the eclipse icon.

 setup eclipse for selenium web driverCongrats,  Now your eclipse is configured successfully.

 Open eclipse When you run this first time it will ask you to choose a work directory or workspace you need to select a folder in your HDD or It will store your project in the default directory. you can change the workspace in future also so don’t worry about It.

 setup eclipse for selenium web driver

Create a new project or your first project with selenium web driver.

File-> New->Java project setup eclipse for selenium web driver

If you are not getting Java project in the list then you need to click on others and search for the java project. Eclipse will create a project for you automatic now you need to create the main class a start write the selenium script.

Write A test script for the demo

package com.SeleniumEasyTestCases;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class SeleniumWithCodebun {
  
  static WebDriver driver;
  
  public static void main(String args[]){
    
    System.setProperty("webdriver.chrome.driver","D:\\Automation\\selenium\\lib_files\\chrome\\chromedriver.exe");
    driver=new ChromeDriver();
    driver.manage().window().maximize();
    driver.get("http://www.seleniumeasy.com/test/");
    driver.close();
  }

}

Note: This script is only for the demo we will see code explanation and everything in details in the upcoming tutorials.

Add a Comment

Your email address will not be published. Required fields are marked *