Default WebDriver Creation

By default, WebTau creates https://www.selenium.dev Selenium WebDriver by pointing to a local browser. WebTau also downloads a driver using https://github.com/bonigarcia/webdrivermanager WebDriver Manager.To handle scenarios where local browsers are not an option, WebTau provides an integration with https://www.testcontainers.org Test Containers.

Explicit Selenium Test Containers

To support https://www.testcontainers.org Test Containers explicitly, WebTau expose browser.setDriver to force a specific driver to use: @WebTau public class BrowserTestContainerJavaTest { private final PageElement box = $("#search-box"); private final PageElement results = $("#results .result"); private final PageElementValue<Integer> numberOfResults = results.count; private static BrowserWebDriverContainer<?> seleniumContainer; @BeforeAll public static void setupDriverUsingTestContainer() { step("preparing selenium test container", () -> { Testcontainers.exposeHostPorts(browser.getBaseUrlPort()); FirefoxOptions firefox = new FirefoxOptions(); seleniumContainer = new BrowserWebDriverContainer<>() .withCapabilities(firefox); seleniumContainer.start(); browser.setDriver(new RemoteWebDriver(seleniumContainer.getSeleniumAddress(), firefox)); }); } @AfterAll public static void shutdownContainer() { seleniumContainer.stop(); } @Test public void search() { browser.open("/search"); box.setValue("search this"); box.sendKeys(browser.keys.enter); numberOfResults.waitToBe(greaterThan(1)); } }

Implicit Selenium Test Container

WebTau provides an option to simplify running tests using both local and https://www.testcontainers.org Test Containers based browser: browserId=firefox browserUrl=http://host.testcontainers.internal:8080 browserTestcontainersEnabled=true @WebTau public class BrowserImplicitTestContainerJavaTest { private final PageElement box = $("#search-box"); private final PageElement results = $("#results .result"); private final PageElementValue<Integer> numberOfResults = results.count; @Test public void search() { browser.open("/search"); box.setValue("search this"); box.sendKeys(browser.keys.enter); numberOfResults.waitToBe(greaterThan(1)); } } Read getting-started/configuration Configuration page to learn about how to override config values using different environments, system properties or environment variables.

Dependency

By default, WebTau includes https://www.testcontainers.org Test Containers into groovy-standalone-runner/introduction Groovy Runner and into single catch-all dependency Groovy <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-groovy</artifactId> <version>2.4</version> </dependency> Java <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau</artifactId> <version>2.4</version> </dependency> If you cherry-pick WebTau dependencies, then you need to add this to your list: <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-browser-testcontainers</artifactId> <version>2.4</version> </dependency>