Today’s automation tests should possess readability characteristics, consisting of fluidness, clarity and flexibility. In spite of the fact that the majority of the examples litter the internet promoting page-object design with: fragment statements, choppy commands and multiple line assertion blocks; yet, rarely address readability as a first class citizen.
Despite the enormous power page-objects furnish, the design alone does not provide all the required mechanisms to construct high-level readable tests with the attributes as described above. To achieve this new level of readability required a new approach and a new design. A design that is flexible, with a straightforward implementation, and one that already works with existing page-objects.
The HPA design (Handlers-Page Objects-Assertions) provides the fluidness for tests to move from page-object to page-object, while displaying visual clues where the reader is within the application. In addition, it exposes assertion methods within the test to determine the "expectation of correctness”. Integrating the Handler and Assertions classes with the Page-Object design, test readability simply explodes — with clean, readable assertions, rich details and elimination of boiler-plate code.
Note
Currently, HPA has been implemented in Java across numerous applications from typical multiple page application to SPAs (Single Page Application), in addition, the design should be easily applicable to C#, and could be applied to the scripting languages as well.