Setting Up Selenium with Java – Complete Installation Guide

Step-by-step guide to install Java, IDE, Maven, and Selenium WebDriver dependencies.

This entry is part 2 of 2 in the series Selenium With Java

Before we can automate with Selenium, we need to prepare our environment.

1️⃣ Install Java

  • Download and install JDK 11+Adoptium JDK
  • Verify installation:
java -version

2️⃣ Install IDE

Use IntelliJ IDEA (recommended) or Eclipse.

3️⃣ Install Build Tool (Maven)

Check if installed:

mvn -version

4️⃣ Create a Maven Project

Run:

mvn archetype:generate -DgroupId=com.selenium.demo -DartifactId=selenium-java-demo -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

5️⃣ Add Selenium Dependency in pom.xml

<dependencies>
  <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.25.0</version>
  </dependency>
</dependencies>

6️⃣ Download Browser Drivers

👉 Pro tip: Use WebDriverManager (by Boni Garcia) to auto-manage drivers.

<dependency>
  <groupId>io.github.bonigarcia</groupId>
  <artifactId>webdrivermanager</artifactId>
  <version>5.9.2</version>
</dependency>

Series Navigation<< Introduction to Selenium with Java – The Evergreen Automation Tool

Leave a Reply

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