Web Browser Module

tapir’s web browser implementations are organized in optional modules. tapir delivers four built-in browser modules, but feel free to add a module for your favorite web browser (emulation).

Chrome

Dependency

<dependency>
    <groupId>de.bmiag.tapir</groupId>
    <artifactId>tapir-selenium-chrome</artifactId>
</dependency>

Activation

Chrome is activated by setting the browser property:

browser=chrome

Properties

Property Info Description
chrome.connection.mode

Possible values: local, remote

Default: local

Specifies if the Chrome connection should be established locally or remotely, see ChromeConnectionMode.
chrome.chromedriver.binary   Location of the ChromeDriver binary. If this property is not specified, tapir tries to download the latest chrome driver (or uses a cached one).
chrome.browser.binary   Location of the Chrome browser binary. Required if the connection mode is local and the binary is not in the path environment variable
chrome.driverservice.url   URL of the driver server. Required if the connection mode is remote.
chrome.headless.mode Default: false Specifies if Chrome should be started in headless mode (without visible UI)

To run tapir tests with Chrome, you have to fire up the ChromeDriver which acts as a bridge between your test code and the Chrome browser. For further information consult the ChromeDriver website. Ensure that the ChromeDriver you use is compatible with your Chrome browser version.

The Chrome integration is very fast and reliable, so using tapir in conjunction with Chrome is recommended.

Firefox

Dependency

<dependency>
    <groupId>de.bmiag.tapir</groupId>
    <artifactId>tapir-selenium-firefox</artifactId>
</dependency>

Activation

Firefox is activated by setting the browser property:

browser=firefox

Properties

Property Info Description
firefox.connection.mode

Possible values: local, remote, legacy

Default: legacy

Specifies if the Firefox connection should be established via the legacy mode or the gecko driver (local/remote), see FirefoxConnectionMode.

firefox.geckodriver.binary   Location of the GeckoDriver binary. If this property is not specified, tapir tries to download the latest gecko driver (or uses a cached one).
firefox.browser.binary   Location of the Firefox browser binary. Required if the connection mode is local or legacy and the binary is not in the path environment variable
firefox.driverservice.url   URL of the driver server. Required if the connection mode is remote.
firefox.headless.mode Default: false Specifies if Firefox should be started in headless mode (without visible UI)
firefox.connection.timeout Default: 60 Connection timeout to the Firefox browser in seconds.

Firefox 48 and above does not support the legacy connection mode anymore. To run tapir tests, you have to fire up the GeckoDriver which acts as a bridge between your test code and the Firefox browser. For further information consult the GeckoDriver website. Ensure that the GeckoDriver you use is compatible with your Firefox browser version.

Firefox < 48 does not require the GeckoDriver. Selenium WebDriver interacts with the web browser directly. You have to switch the connection mode to legacy.

The Firefox integration (especially the one based on the GeckoDriver) is not feature-complete and therefore not as stable as the Chrome integration.

Internet Explorer

Dependency

<dependency>
    <groupId>de.bmiag.tapir</groupId>
    <artifactId>tapir-selenium-ie</artifactId>
</dependency>

Activation

Internet Explorer is activated by setting the browser property:

browser=internetexplorer

Properties

Property Info Description
internetexplorer.connection.mode

Possible values: local, remote

Default: local

Specifies if the Internet Explorer connection should be established locally or remotely, see InternetExplorerConnectionMode.

internetexplorer.driverservice.binary   Location of the DriverServer binary. If this property is not specified, tapir tries to download the latest Internet Explorer driver (or uses a cached one).
internetexplorer.driverservice.url   URL of the driver server. Required if the connection mode is remote.

To run tapir tests with Internet Explorer, you have to fire up the DriverServer which acts as a bridge between your test code and the Internet Explorer. For further information consult the InternetExplorerDriver website.

Caution
The Internet Explorer will only work on Windows!

HtmlUnit

Dependency

<dependency>
    <groupId>de.bmiag.tapir</groupId>
    <artifactId>tapir-selenium-htmlunit</artifactId>
</dependency>

Activation

HtmlUnit is activated by setting the browser property:

browser=htmlunit

Properties

There are no special HtmlUnit properties. The proxy settings are configured via HTTP Proxy.

HtmlUnit is a headless web browser implemented in Java. Therefore it does not need any additional binaries. All required depdendencies are provided by tapir. HtmlUnit does not require a graphical user interface.

HtmlUnit is very fast as it does emulate the browser interaction and does not render the web site. For further information consult the HtmlUnitDriver website.

Caution
HtmlUnit does not have a rendering engine, so you cannot see any browser interaction on the screen. Moreover, it's not possible to capture screenshots.