📏 Gauge

Learn Gauge test automation with Java: Markdown specs, @Step bindings, Selenium By locators, @FindBy PageFactory and a JSON locator repository.

Gauge is ThoughtWorks' open-source test automation framework: scenarios are written in plain Markdown and bound to Java step implementations via the @Step annotation. On this page you will learn to build a real E2E framework with Selenium By locators, @FindBy/PageFactory, and a JSON locator repository.

What you can learn on this page

  • 🏠 Why Gauge? — Gauge works like a restaurant's "order ticket" system: the waiter (test author) writes the order in the customer's language — "1 grilled meatball, medium rare" — and the kitchen (Java step implementation) reads that ticket and does the tech
  • ⚙️ Setup — Installing Gauge is like buying a drill plus a bit set: you first get the body (the gauge CLI), but the body alone drills nothing — you must attach the right bit for the material (the java plugin, the html-report plugin). That is why installation has TWO stage
  • 📝 Spec & Step Basics — The relationship between a spec file and a step implementation is that of sheet music to a pianist: the sheet (.spec) says WHAT to play line by line, the pianist (the @Step method) knows HOW to strike each note. The critical mechanism is matching: every symbol
  • 🎯 Locators with By — A By locator is the address description you hand a courier, and the TYPE of description decides the delivery's fate: By.id is like a national ID number — unique and direct on the page, it finds the door on the first try; By.cssSelector is "neighborhood +
  • 🗂️ JSON Locator Repository — A JSON locator repository is a library's card catalog: the books (elements) sit on shelves, but WHICH book is on WHICH shelf is recorded in one central catalog (locators.json). When books move, you don't walk every shelf — you update the catalog card, and EVER
  • 🌍 Ecosystem & CI/CD — The env/ folder resembles a theater troupe's touring schedule: the same script (Java step code) is performed in Istanbul, Izmir, and Ankara — the actors do not change their lines by city, but each city's stage crew reconfigures the lighting/sound (base URL, ti
  • 🚨 Real-Life Issues — Reading an error message is like a doctor going from symptom to diagnosis: fever (a red test) alone names no disease — the doctor examines what accompanies it (sore throat? cough?). In the Gauge + Selenium stack the same failure color (FAIL) can come from at l
  • 💼 Interview Q&A — A scenario-based interview question resembles the "engine failure" drill in a flight simulator: the pilot may have never faced a real engine failure, yet the simulator corners them with "Engine 2 just died, what do you do?" — because the ai