SeleniumExampleTest.java opens https://the-internet.herokuapp.com in headless Chrome with Selenium and tracks two screenshots with sdk-java, the second with test run options and an ignore area.
- JDK 25 or later and Maven
- Google Chrome; Selenium Manager downloads a matching chromedriver
- A running Visual Regression Tracker 6.0 server and its API key
- Copy
vrt.json.exampletovrt.jsonand set your connection, or use theVRT_*environment variables, which override the file
mvn testenableSoftAssert is on: the SDK logs a failed check through SLF4J instead of throwing, so the test passes. The examples have no SLF4J binding, so the log stays silent; add one, such as slf4j-simple, to see it.
- First run: the VRT UI shows a build with two new test runs, "Home page" and "Checkboxes page". Approve them to make them the baseline for the branch.
- Next runs: the test runs are
Okwhile the pages look the same. When one changes, it isUnresolved, and the build shows the diff to approve or reject.
Set enableSoftAssert to false to make new and changed screenshots fail the test.