Prepare Java and Maven
The GitHub example requires Java 21+, Maven 3.9+ and a browser (Chrome, Firefox or Edge).
Use the ready-made Java example or add TestZombie to existing Selenium tests through Maven. Keep your tests and try healing.
The GitHub example requires Java 21+, Maven 3.9+ and a browser (Chrome, Firefox or Edge).
The project already includes TestZombie, Selenium, JUnit and a runnable test flow.
git clone https://github.com/testzombie/testzombie-example-selenium-java.git
cd testzombie-example-selenium-javaRegister for free and use your API key and account email. The example accepts them as Maven properties.
mvn test -Dtestzombie.apikey=YOUR_API_KEY -Dtestzombie.email=YOUR_EMAILThe demo deliberately changes UI elements. Run different mutation levels and inspect healing in test runs.
Add the Java library to your pom.xml. The version below matches the current example project; check Maven Central for available releases. Then create the driver through TestZombie instead of ChromeDriver.
<dependency>
<groupId>com.testzombie</groupId>
<artifactId>testzombie-lib-java</artifactId>
<version>1.2.0</version>
</dependency>TestZombieDriver.setCredentials(apiKey, accountEmail);
WebDriver driver = TestZombieDriver.createChrome();Check the API key, account email and network access to the TestZombie API.
A normal test can succeed without healing. Try the mutation levels described in the repository to see healing in action.
Source updates are optional. Start with preview and review changes before applying them.
You can inspect test runs and healing logs in your dashboard. TestZombie may repair a broken locator; real application failures still fail. Successful locator fixes can optionally be reviewed and applied as source updates.