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
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)
<dependency>
<groupId>io.github.seleniumboot</groupId>
<artifactId>selenium-boot</artifactId>
<version>3.3.0</version>
</dependency>
dependencies {
testImplementation 'io.github.seleniumboot:selenium-boot:3.3.0'
}
test {
useTestNG()
systemProperties System.properties
}
dependencies {
testImplementation("io.github.seleniumboot:selenium-boot:3.3.0")
}
tasks.test {
useTestNG()
systemProperties(System.getProperties().mapKeys { it.key.toString() })
}
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).
This example uses https://example.com — a stable real site reserved for
documentation — so you can copy the files as-is and mvn test goes green.
Swap in your own URL once it passes.
execution:
mode: local
baseUrl: https://example.com
browser:
name: chrome
headless: false
retry:
enabled: true
maxAttempts: 2
timeouts:
explicit: 10
pageLoad: 30
Step 3 — Write your first test
Copy this as-is — it passes against the baseUrl from Step 2 with a real
Chrome, no changes needed:
import com.seleniumboot.locator.Role;
import com.seleniumboot.test.BaseTest;
import org.testng.annotations.Test;
public class SmokeTest extends BaseTest {
@Test
public void opensThePage() {
open(); // navigates to baseUrl
assertThat(getByRole(Role.HEADING, "Example Domain")).isVisible();
}
}
getByRole finds elements the way a screen reader does, and
assertThat(...).isVisible() retries until the timeout instead of failing on
the first miss — so no WebDriverWait, no CSS selectors, no Thread.sleep().
Once this passes, point execution.baseUrl at your app and replace the
assertion with a locator for your page — e.g.
assertThat(getByRole(Role.BUTTON, "Sign in")).isVisible().
Step 4 — Create a TestNG suite
<?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="SmokeTest"/>
</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/
└── SmokeTest.java
your-project/
├── build.gradle (or build.gradle.kts)
├── selenium-boot.yml
├── testng.xml
└── src/test/java/
└── SmokeTest.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