Assertion chaining with Hamcrest

In some cases we want to assert more than one thing in a test. For instance when testing a financial application with a chart of accounts that contains multiple calculated fields. Those fields change after […]

A guide to clear assertions with Hamcrest

A good practice in test automation is the use of Descriptive And Meaningful Phrases (also known as DAMP). This means that our tests clearly tell us what they do in language that is relevant to […]

Dealing with moving focus

Problem Imagine the following situation: after accepting a confirmation dialog you will be redirected to another page. This recipe will explain how to deal with this inevitable situation. Prerequisites We have made a class file […]

Page Object Model – Introduction

Creating Selenium test cases can result in an unmaintainable project. One of the reasons is that too many duplicated code is used. Duplicated code could be caused by duplicated functionality and this will result in […]

Set up a Selenium project environment

Problem This recipe will describe how we can set up our project environment. We will use Eclipse as development environment as further examples will be written in Java, but we can use any IDE which […]

Model the application interface

The first step we have to take in implementing the page object model is that we have to model the user experience. This means that all page specific elements has to be extracted to separate […]