- Introduction to Selenium with Java – The Evergreen Automation Tool
- Setting Up Selenium with Java – Complete Installation Guide
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
- ChromeDriver for Chrome
- GeckoDriver for Firefox
👉 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>