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

URL: https://hakangul.lovable.app/blog/introducing-testfly-modern-java-test-automation-framework
Author: Hakan Gül — Team Lead Senior Test Automation Engineer
Published: 2026-08-28
Updated: 2026-08-29
Category: test-automation
Tags: TestFly, Java, Test Automation, SDET, Selenium, TestNG, Open Source

> 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.

## English

## 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
```xml
<dependencies>
    <dependency>
        <groupId>io.testfly</groupId>
        <artifactId>testfly</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
    </dependency>
</dependencies>
```

### 2. `testfly.yml` (Project Root)
```yaml
execution:
  mode: local
  baseUrl: https://example.com

browser:
  name: chrome
  headless: false

timeouts:
  explicit: 10
  pageLoad: 30
```

### 3. Your Test Class
```java
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"
    }
}
```

Run via Maven:
```bash
mvn test
```

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

## Türkçe

## Felsefe: "Selenium'un Spring Boot'u"

Java ekosisteminde kurumsal bir Selenium çatısı kurmak, geleneksel olarak yüzlerce satır altyapı kodu yazmayı gerektirir: `WebDriverManager` ayarları, ThreadLocal izolasyonu, bekleme mekanizmaları ve ekran görüntüsü dinleyicileri.

**TestFly**, konfigürasyon yerine standartları (convention over configuration) benimser:
- **Sıfır Şablon Kod (Zero-Boilerplate):** `BaseTest` sürücü yaşam döngüsünü tamamen üstlenir.
- **Deklaratif YAML:** Ortamlar, zaman aşımları ve tarayıcı ayarları `testfly.yml` içinde tutulur.
- **ThreadLocal İzolasyonu:** Race condition olmadan güvenli ve yerel paralel koşum.
- **Dahili HTML Raporu:** Harici sunucu gerektirmeyen `target/testfly-report.html` raporu.

---

## 60 Saniyede İlk Test

### 1. `pom.xml` Bağımlılığı
```xml
<dependencies>
    <dependency>
        <groupId>io.testfly</groupId>
        <artifactId>testfly</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
    </dependency>
</dependencies>
```

### 2. `testfly.yml` (Proje Kök Dizini)
```yaml
execution:
  mode: local
  baseUrl: https://example.com

browser:
  name: chrome
  headless: false

timeouts:
  explicit: 10
  pageLoad: 30
```

### 3. Test Sınıfınız
```java
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 sayfayiAc() {
        open(); // testfly.yml'deki baseUrl adresini açar
        assertTrue(getDriver().getTitle().contains("Example Domain"));
    }

    @Test
    public void altSayfayaGit() {
        open("/login"); // baseUrl + "/login" adresine gider
    }
}
```

Çalıştırmak için:
```bash
mvn test
```

Manuel `driver.quit()` veya `new ChromeDriver()` yazmaya gerek yoktur. TestFly her şeyi yönetir!
