Getting Started
Get your first Selenium Boot test running in under 5 minutes.
Prerequisites
- Java 17+
- Maven 3.8+ or Gradle 7+
- Chrome or Firefox installed
info
No WebDriver binaries required — Selenium Manager handles browser driver downloads automatically.
Step 1 — Add the dependency
- Maven (pom.xml)
- Gradle Groovy (build.gradle)
- Gradle Kotlin (build.gradle.kts)
pom.xml
<dependency>
<groupId>io.github.seleniumboot</groupId>
<artifactId>selenium-boot</artifactId>
<version>3.1.1</version>
</dependency>
build.gradle
dependencies {
testImplementation 'io.github.seleniumboot:selenium-boot:3.1.1'
}
test {
useTestNG()
systemProperties System.properties
}
build.gradle.kts
dependencies {
testImplementation("io.github.seleniumboot:selenium-boot:3.1.1")
}
tasks.test {
useTestNG()
systemProperties(System.getProperties().mapKeys { it.key.toString() })
}
Using Gradle?
See the full Gradle Setup Guide for parallel config, JUnit 5, optional deps, and report locations.
Step 2 — Create the configuration file
Create selenium-boot.yml in your project root (next to pom.xml or build.gradle):
selenium-boot.yml
browser:
name: chrome
headless: false
execution:
baseUrl: https://your-app.com
retry:
enabled: true
maxAttempts: 2
timeouts:
explicit: 10
pageLoad: 30
Step 3 — Write your first test
src/test/java/com/example/LoginTest.java
import com.seleniumboot.test.BaseTest;
import org.testng.Assert;
import org.testng.annotations.Test;
public class LoginTest extends BaseTest {
@Test(description = "Valid user can log in")
public void loginTest() {
open(); // navigates to baseUrl
// your test steps here
Assert.assertTrue(getDriver().getTitle().contains("Dashboard"));
}
}
Step 4 — Create a TestNG suite
testng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="selenium-boot-suite" verbose="1">
<test name="MyTests">
<classes>
<class name="com.example.LoginTest"/>
</classes>
</test>
</suite>
Step 5 — Run
- Maven
- Gradle
mvn test
./gradlew test
What happens
- Framework loads
selenium-boot.yml - Chrome launches automatically
- Your test runs
- Screenshot captured on any failure
- Browser closes
- HTML report generated at
target/selenium-boot-report.html(Maven) orbuild/selenium-boot-report/(Gradle) - Metrics JSON at
target/selenium-boot-metrics.json
Project structure
- Maven
- Gradle
your-project/
├── pom.xml
├── selenium-boot.yml
├── testng.xml
└── src/test/java/com/example/
├── pages/LoginPage.java
└── tests/LoginTest.java
your-project/
├── build.gradle (or build.gradle.kts)
├── selenium-boot.yml
├── testng.xml
└── src/test/java/com/example/
├── pages/LoginPage.java
└── tests/LoginTest.java
Working example project
A complete working project is available at: https://github.com/seleniumboot/selenium-boot-test
Clone it, run mvn test (or ./gradlew test), and you'll have a full working suite with page objects, step logging, and retry configured.
Next steps
- Configuration Reference — all available config options
- BasePage — write clean page objects
- Step Logging — add named steps to your tests