0% found this document useful (0 votes)
32 views2 pages

Configure Selenium in Eclipse with Java

This document provides a step-by-step guide on configuring Selenium in Eclipse with Java. It covers the installation of Eclipse IDE, Java Development Kit, downloading Selenium libraries, adding JARs to the project, writing a sample test, and running the program. Additionally, it includes instructions for downloading ChromeDriver and optionally adding it to the system PATH.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

Configure Selenium in Eclipse with Java

This document provides a step-by-step guide on configuring Selenium in Eclipse with Java. It covers the installation of Eclipse IDE, Java Development Kit, downloading Selenium libraries, adding JARs to the project, writing a sample test, and running the program. Additionally, it includes instructions for downloading ChromeDriver and optionally adding it to the system PATH.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

How to Configure Selenium in Eclipse with Java

Step 1: Install Eclipse IDE for Java Developers

Download from: [Link]

Install it and launch Eclipse.

Step 2: Install Java (JDK)

Download the latest Java Development Kit (JDK) from:

[Link]

Install and set environment variables:

JAVA_HOME = C:\Program Files\Java\jdk-<version>

Add %JAVA_HOME%\bin to PATH.

Step 3: Create a Java Project in Eclipse

Open Eclipse -> File -> New -> Java Project

Enter project name (e.g., SeleniumDemo) and click Finish.

Step 4: Download Selenium WebDriver Java Libraries

Visit: [Link]

Download Selenium Client for Java.

Extract ZIP to get [Link] and libs folder.

Step 5: Add Selenium JARs to Your Project

Right-click your project -> Build Path -> Configure Build Path -> Libraries -> Add External JARs

Add all JARs from Selenium folder and libs subfolder.

Step 6: Write Your First Selenium Test

Sample Code:

import [Link];

import [Link];

public class FirstTest {


public static void main(String[] args) {

[Link]("[Link]", "C:\\path\\to\\[Link]");

WebDriver driver = new ChromeDriver();

[Link]("[Link]

[Link]("Page Title: " + [Link]());

[Link]();

Step 7: Download ChromeDriver

Go to: [Link]

Download version matching your Chrome browser.

Extract [Link] to a folder (e.g., C:\SeleniumDrivers\).

Step 8: Run the Program

Right-click your Java file -> Run As -> Java Application

Chrome browser will launch and open Google.

Optional: Add ChromeDriver to System PATH

Add C:\SeleniumDrivers to system PATH.

Then you can skip using [Link] in your code.

You might also like