Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Html Elements framework

release Maven Central

This framework is designed to provide an easy-to-use way of interacting with web-page elements in your tests. It can be considered to be an extension of WebDriver Page Object.

With the help of the Html Elements framework you can group web-page elements into blocks, encapsulate logic of interaction within them and then easily use created blocks in page objects. It also provides a set of helpful matchers to use with web-page elements and blocks. See JavaDocs and Samples for more details.

You can ask your questions on StackOverflow with the htmlelements tag.

Other Languages

In case you are not a Java guy/gal, don't panic, there are still few options:

Release Notes

Include Html Elements in your project

Maven dependencies for Html Elements core:

    <version>1.21.0</version> <!-- 1.21+ is SELENIUM 4.1.0 compatible -->

And for Thucydides integration:


Or you can include all modules at once if needed:


Since 1.15 Java 8 is required. Please use 1.14 for Java 7 support.

Create blocks of elements

For example, let's create a block for the search form on the page

@Name("Search form")
@FindBy(xpath = "//form")
public class SearchArrow extends HtmlElement {

    @Name("Search request input")
    @FindBy(id = "searchInput")
    private TextInput requestInput;

    @Name("Search button")
    @FindBy(className = "b-form-button__input")
    private Button searchButton;

    public void search(String request) {

Construct page object using created blocks

You can easily use created blocks in page objects:

public class SearchPage {

    private SearchArrow searchArrow;
    // Other blocks and elements here ...

    public SearchPage(WebDriver driver) {
        PageFactory.initElements(new HtmlElementDecorator(new HtmlElementLocatorFactory(driver)), this);

    public void search(String request) {;

    // Other methods here ...

Use page objects in your tests

Created page objects can be used in your tests. This makes tests more concise, easier to maintain, and easy to write.

public class SampleTest {

    private WebDriver driver = new FirefoxDriver();
    private SearchPage searchPage = new SearchPage(driver);

    public void loadPage() {

    public void sampleTest() {"yandex");
        // Some assertion here

    public void closeDriver() {


In case you can't find an answer in documentation and examples provided above, you can ask it on StackOverflow with the htmlelements tag.