Skip to main content
SeleniumDecoded
All Chapters Chapter 6

Design Patterns

Page Object Model, Page Factory, Screenplay, driver factories, and data-driven test architecture

  1. 1

    Page Object Model

    Learn the Page Object Model (POM) design pattern for writing maintainable and scalable Selenium tests.

    Selenium 3 & 4 Stable
  2. 2

    Page Factory

    Use Page Factory pattern to initialize page elements with annotations for cleaner page objects.

    Selenium 3 & 4 Stable
  3. 3

    Data-Driven Testing

    Run the same test with different data sets using external files, databases, and parameterization.

    Selenium 3 & 4 Stable
  4. 4

    Screenplay Pattern

    A user-centred alternative to Page Objects built from Actors, Abilities, Tasks, Interactions and Questions. When it beats POM, when it does not, and a complete implementation in four languages.

    Selenium 3 & 4 Stable
  5. 5

    Driver Factory and Thread Safety

    Build a WebDriver factory that reads configuration, supports local, Grid and cloud targets, and hands each parallel test its own driver via ThreadLocal or fixtures without leaks.

    Selenium 4 Stable