DEV Community

Cover image for TestFly Part 1: The Spring Boot of Selenium — Zero-Boilerplate Java Test Automation
Hakan GÜL
Hakan GÜL

Posted on Originally published at hakangul.lovable.app AI-assisted

TestFly Part 1: The Spring Boot of Selenium — Zero-Boilerplate Java Test Automation

Discover TestFly, an opinionated Java 17+ test automation framework. Learn how BaseTest, testfly.yml, and ThreadLocal driver management deliver green tests in under 60 seconds.

The Philosophy: "The Spring Boot of Selenium"
Building an enterprise-grade Selenium framework in Java has traditionally meant writing hundreds of lines of repetitive infrastructure code: configuring WebDriverManager, synchronizing thread-local instances, managing wait strategies, and setting up screenshot listeners.

TestFly changes this with a convention-over-configuration philosophy:

Zero-Boilerplate Lifecycle: BaseTest owns driver instantiation and teardown.
Declarative YAML: Environment, timeouts, and execution parameters live in a clean testfly.yml.
Thread-Local Isolation: Safe, out-of-the-box parallel execution without race conditions.
Native HTML Reporting: Instant, self-contained reports at target/testfly-report.html.

60-Second Quickstart

  1. pom.xml Dependency
<dependencies>
    <dependency>
        <groupId>io.testfly</groupId>
        <artifactId>testfly</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
    </dependency>
</dependencies>
Enter fullscreen mode Exit fullscreen mode
  1. testfly.yml (Project Root)
execution:
  mode: local
  baseUrl: https://example.com

browser:
  name: chrome
  headless: false

timeouts:
  explicit: 10
  pageLoad: 30
Enter fullscreen mode Exit fullscreen mode
  1. Your Test Class
package io.testfly.examples;

import io.testfly.test.BaseTest;
import org.testng.annotations.Test;
import static org.testng.Assert.assertTrue;

public class SmokeTest extends BaseTest {

    @Test
    public void opensThePage() {
        open(); // navigates to execution.baseUrl from testfly.yml
        assertTrue(getDriver().getTitle().contains("Example Domain"));
    }

    @Test
    public void navigatesToSubpath() {
        open("/login"); // navigates to baseUrl + "/login"
    }
}
Enter fullscreen mode Exit fullscreen mode

Run via Maven:
mvn test

No driver.quit() or new ChromeDriver() needed. TestFly handles everything!

Top comments (0)