Skip to main content

Selenium Boot

An opinionated, Spring Boot–inspired Java test automation framework.

Maven Central License


What is Selenium Boot?

Selenium Boot eliminates the boilerplate that every Java Selenium project repeats — WebDriver setup and teardown, wait helpers, retry logic, screenshot capture, and report generation — so your test code contains only test intent.

It is inspired by Spring Boot's philosophy: sensible defaults, convention over configuration, and zero required setup for common cases.

public class LoginTest extends BaseTest {

@Test(description = "Valid user can log in")
public void loginTest() {
open();
new LoginPage(getDriver()).login("admin", "secret");
Assert.assertTrue(new DashboardPage(getDriver()).isLoaded());
}
}

No WebDriver setup. No @AfterMethod teardown. No wait helpers. No retry configuration. Just the test.


AI-powered test authoring

seleniumboot-mcp lets Claude or GitHub Copilot control a real browser, record your session, and generate Selenium Boot test code — TestNG, JUnit 5, Page Object, Gherkin, C# NUnit — in one prompt.

pip install seleniumboot-mcp

76 tools · self-healing locators · mobile emulation · codegen for Java / Python / C# / Playwright

PyPI · GitHub


What you get out of the box

FeatureDetails
Driver lifecycleOne driver per thread, created before each test, quit after
YAML configurationBrowser, parallel, timeouts, retry — all in one file
Smart waitsWaitEngine with 10+ built-in conditions
RetryGlobal, per-method @Retryable, or per-Cucumber-scenario @retryable tag
ScreenshotsAuto-captured on failure, base64-embedded in report
Step loggingNamed steps with optional per-step screenshots
HTML reportTabbed dashboard — overview, test cases, failures, flakiness radar
JUnit XMLParsed natively by Jenkins, GitHub Actions, GitLab CI
CI auto-detectionHeadless forced, threads auto-tuned, no config changes needed
ExtensibilitySPI-based plugins, custom drivers, hooks, report adapters
JUnit 5Full feature parity via @ExtendWith(SeleniumBootExtension.class) or BaseJUnit5Test
BDD / CucumberBaseCucumberSteps, CucumberHooks, per-scenario steps in HTML report
API testingBaseApiTest, fluent ApiClient, JSONPath, schema validation, hybrid UI+API
Fluent locators$("selector").filter().nth().withText() — Playwright-style chainable locators
Web-first assertionsassertThat(By.id("x")).isVisible() — auto-retrying until timeout
Multi-session testingwithSession("admin", () -> { ... }) — two browsers in one test
Database assertionsdb().assertRowExists(), db().query().assertValue() — plain JDBC, no ORM
Email verificationmailbox().waitForEmail(to("user@test.com")) — Mailhog, Mailtrap, Outlook, IMAP
@NoBrowserSkip WebDriver for non-UI tests — DB assertions, API checks, file operations
BrowserStack / Sauce Labsexecution.mode: browserstack or saucelabs — cloud browsers with session URL in HTML report
AI failure analysisClaude explains why a test failed and suggests a fix
Self-healing locatorsAutomatic fallback strategies when a locator fails
Flakiness predictionRisk scores from run history, radar chart in report
External test data@TestData("csv:..."), @TestData(value="excel:...", sheet="Login"), @TestData("db:SELECT...")
Clock mockingclock().set("2030-01-01T00:00:00Z") — JS Date override, auto-reset after each test

Philosophy

  1. Zero boilerplate — if the user writes more than 1 line to enable something, it should be a default
  2. Convention over configuration — smart defaults, YAML opt-in for advanced behaviour
  3. No required external services — works offline, no cloud APIs in core
  4. Opt-in complexity — advanced features behind config flags, off by default
  5. Single dependency — add selenium-boot and nothing else is required
  6. Test code stays clean — internals handle lifecycle; test methods contain only intent

Next steps