Description
Selenium is an umbrella project encapsulating a variety of tools and libraries enabling web browser automation. Selenium specifically provides an infrastructure for the W3C WebDriver specification — a platform and language-neutral coding interface compatible with all major web browsers.Examples
Dependency:
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>selenium</artifactId>
<version>1.20.0</version>
<scope>test</scope>
</dependency>
Usage:
var chrome = new BrowserWebDriverContainer<>()
withCapabilities(new ChromeOptions())
chrome.start();
Dependency:
dotnet add package Testcontainers.WebDriver --version 3.9.0
Usage:
var WebDriverContainer = new WebDriverBuilder()
.WithBrowser(WebDriverBrowser.Chrome)
.Build();
await WebDriverContainer.StartAsync();
Dependency:
npm install @testcontainers/selenium --save-dev
Usage:
const container = await new SeleniumContainer("selenium/standalone-chrome:112.0").start();
Dependency:
pip install testcontainers[selenium]
Usage:
with BrowserWebDriverContainer(DesiredCapabilities.CHROME) as chrome:
webdriver = chrome.get_driver()