11 Test automation design patterns for the UI layer

This chapter covers

  • The limitations of unstructured test scripts
  • Page Objects and Page Component Objects
  • Modeling user interfaces and user behavior
  • Action classes and DSLs

In the previous chapter, you learned how to automate a web page using basic Selenium WebDriver code. In this chapter, you will learn how to organize and structure your UI test code to make it easier to extend and easier to maintain.

11.1 The limitations of unstructured test scripts

Thus far we’ve explored the WebDriver API using very simple code samples. These examples work well to illustrate the various WebDriver methods, but you wouldn’t want to write code like this for real-world automated tests. For example, to log on ...

Get BDD in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.