Skip to content

Posts tagged ‘fluent’


Thucydides Release 0.8.8 – A more fluent API for Page Objects

We released a new version of Thucydides (0.8.8) yesterday with an exciting new feature and some bug fixes. Here’s a list of what went in.

A fluent API for Page objects

The Page Object API has been enhanced for a more readable, fluent interface with new methods like ‘find’, ‘findBy’ , ‘then’ and ‘waitFor’ etc.

For example, you can use webdriver ‘By’ finders as follows:




The new method ‘waitFor’ and its derivatives ‘waitForPresenceOf’ and ‘waitForAbsenceOf’ offer more concise and expressive alternatives to the existing wait methods. These methods take a String argument representing the xpath or css selector and can be used as follows:


Other changes and Bug Fixes

  • Performance improvement: screenshots are now written to the disk in the background, so as not to slow down the tests.
  • (#THUCYDIDES-61) You can now define Thucydides properties in a file in the working directory.
  • (#THUCYDIDES-60) A new system option, ‘thucydides.jquery.integration’, has been added to deactivate JQuery integration.
  • (#THUCYDIDES-59) Duplicated screen shots are now removed.
  • (#THUCYDIDES-57)  If there are two or more consecutive steps with the same name, second and next screen shots were not presented in the report due to this bug. Now there will be at least one screen shot for each step.
  • (#THUCYDIDES-56) Added the withActions() method to the PageObject class to support the WebDriver Actions API. You can also invoke WebDriver Actions directly e.g.,
    Actions builder = new Actions(page.getDriver());
  • (#THUCYDIDES-55) You can now call the JavascriptExecutorFacade directly with the driver obtained from the PageObject class e.g.,
    JavascriptExecutorFacade js = new JavascriptExecutorFacade(page.getDriver());

    The executeScript() method also supports passing parameters to the Javascript function

  • (#THUCYDIDES-53) Fixed a bug that was causing report files to get split in two directories  when maven “build directory” was changed.
  • (#THUCYDIDES-54) Fixed NullpointerException in Android emulator.
  • (#THUCYDIDES-50) A minor bug with inconsistent naming of reports for data driven tests has been fixed.
  • (#THUCYDIDES-13,15) All tests in a given unit test now run in a single browser session.
  • Statistics are now tied to a project, so that multiple projects can be logged in the same database.

Let us know how the changes look.