Web Framework Module

tapir’s Selenium integration is able to automate the interaction with any web framework. By default, only basic HTML components are implemented, but you can build tapir components for the components of your web application. For further information consult the chapter HTML Components.

It’s recommended to divide each web framework binding into an API and an Implementation module. The API module provides some interfaces which reflect the possibilities a component offers to the user. The Implementation module provides an implementation of the API.

Dependencies

In order to use the basic HTML components you have to add this compile-time dependency…

<dependency>
    <groupId>de.bmiag.tapir</groupId>
    <artifactId>tapir-html-basic-api</artifactId>
</dependency>

… and this runtime dependency:

<dependency>
    <groupId>de.bmiag.tapir</groupId>
    <artifactId>tapir-html-basic-impl</artifactId>
</dependency>

Example

Let’s take a closer look at a Button component. Imagine how a user can interact with a button. The major action he can perform is clicking the button. Beside this action he can decide, if the button is displayed (or hidden) and if it is enabled (clickable). The corresponding interface exactly reflects these possibilities by providing the following methods:

  • boolean isDisplayed()
  • boolean isEnabled()
  • void click()

All of these methods are inherited from interfaces which are defined in tapir’s UI API:

This is the complete Button interface:

Button.java

public interface Button extends TapirElement, Displayable, Clickable, Enabable {
}

Caution
Notice the extended TapirElement. This is an important marker interface as tapir handles interfaces which extend TapirElement specifically. Read Selenium Core module for more information.

We don’t want to investigate the implementation further as this is subject of the corresponding customization chapter.