Chapter 5. Design Patterns

A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. In this chapter, we will take a look at good design patterns to create maintainable and reusable bits of code that we can use with our Selenium tests. This means that, if there are any changes needed to our web application, or any changes in the way we need to find elements, we can change them once and have things fixed very quickly.

In this chapter, we will learn the following topics:

  • Using Page Object design
  • Using the PageFactory Selenium library in Page objects
  • Using the LoadableComponents Selenium library

In this chapter, it is assumed that all files will have the following import statements:

import ...

Get Learning Selenium Testing Tools - Third 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.