You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9ba2d77
Browse filesBrowse the repository at this point in the historyBrowse files
Grab the jar from the [latest release](https://github.com/seleniumboot/selenium-boot-migrator/releases/latest). Requires Java 17+.
151
-
152
-
> **Let an AI assistant drive a real browser and write the tests**
153
-
> **seleniumboot-mcp** is a standalone MCP server for Claude / GitHub Copilot: it controls Chrome, records your session, and generates ready-to-run test code (Java TestNG / JUnit 5 / Gherkin, Python, C#, Playwright) — Selenium Boot-native when the dependency is present. Its `migrate` tool runs the analysis above for you.
Selenium Boot is an opinionated framework for Java Selenium, inspired by Spring Boot. Add one dependency, extend `BaseTest` / `BasePage`, and the driver lifecycle, waits, retries, reporting and CI wiring are already decided.
@@ -175,41 +155,39 @@ Already on Selenium? You keep your stack, TestNG, team skills and Grid, and gain
175
155
Outcomes first — the API that delivers each one is named so you can find it in the docs.
176
156
177
157
- **No driver setup, teardown or `Thread.sleep()`** — thread-safe WebDriver lifecycle per test and an auto-waiting `WaitEngine`
178
-
- **Tests survive CSS and DOM refactors** — accessibility-first locators (`getByRole`, `getByText`, `getByLabel`, `getByPlaceholder`, `getByTestId`, `getByAltText`, `getByTitle`) plus a `SmartLocator` fallback
179
-
- **Flaky tests stop failing your build** — automatic retry via `@Retryable`
158
+
- **Tests less coupled to markup** — accessibility-first locators (`getByRole`, `getByText`, `getByLabel`, `getByPlaceholder`, `getByTestId`, `getByAltText`, `getByTitle`) plus a `SmartLocator` fallback
159
+
- **Transient failures don't fail the build** — automatic retry via `@Retryable`; flaky tests are still reported as retried
180
160
- **Parallel runs that are safe** — thread-isolated drivers, `parallel` in one YAML line
181
161
- **See exactly why a test failed** — screenshot on failure, `StepLogger` named steps, and an HTML report with pass-rate gauge, slowest tests and step timeline
182
162
- **Write pages, not plumbing** — `BasePage` with wait-backed `click`, `type`, `getText`, iFrame helpers and file upload; `@PreCondition` logs in once and reuses the session
183
163
- **UI and API in the same suite** — `BaseApiTest` + fluent `ApiClient` with auth, schema validation and JSONPath
184
-
- **CI that configures itself** — auto-detects GitHub Actions, Jenkins, CircleCI; forces headless, emits JUnit XML
164
+
- **CI-aware defaults** — detects GitHub Actions, Jenkins, CircleCI and others; forces headless, emits JUnit XML
185
165
186
166
Also built in: accessibility checks (axe-core bundled), download testing, JavaScript console-error capture, environment profiles, and SPI plugins for custom drivers, report adapters and hooks.
187
167
188
168
---
189
169
190
170
## Page Objects and Tests
191
171
192
-
Extend `BasePage` for wait-backed `click`, `type`, `getText`, `getAttribute`, `isDisplayed`, `withinFrame` and `upload`:
172
+
Extend `BasePage` for the same semantic locators plus wait-backed helpers (`click`, `type`, `getText`, `isDisplayed`, `withinFrame`, `upload`):
193
173
194
174
```java
195
175
public class LoginPage extends BasePage {
196
176
197
-
private final By usernameField = By.id("username");
198
-
private final By passwordField = By.id("password");
199
-
private final By loginButton = By.id("login-btn");
200
-
201
177
public LoginPage(WebDriver driver) {
202
178
super(driver);
203
179
}
204
180
205
181
public void login(String username, String password) {
206
-
type(usernameField, username);
207
-
type(passwordField, password);
208
-
click(loginButton);
182
+
getByLabel("Username").type(username);
183
+
getByLabel("Password").type(password);
184
+
getByRole(Role.BUTTON, "Log in").click();
209
185
}
210
186
}
211
187
```
212
188
189
+
Prefer semantic locators. When an element has no accessible name, fall back to `By` — `type(By.id("username"), username)` — or to the raw `WebDriver`.
190
+
213
191
Extend `BaseTest` — that's all the setup a test needs:
Grab the jar from the [latest release](https://github.com/seleniumboot/selenium-boot-migrator/releases/latest). Requires Java 17+.
277
+
278
+
> **Let an AI assistant drive a real browser and write the tests**
279
+
> **seleniumboot-mcp** is a standalone MCP server for Claude / GitHub Copilot: it controls Chrome, records your session, and generates ready-to-run test code (Java TestNG / JUnit 5 / Gherkin, Python, C#, Playwright) — Selenium Boot-native when the dependency is present. Its `migrate` tool runs the analysis above for you.
0 commit comments