Page objects and other test design patterns
Keep the what of a check apart from the where: page objects, layers and the Screenplay pattern, in plain words.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a television (TV) remote. A remote has one button for each action. You press volume up. You do not open the TV and rewire it. If the maker changes the wiring inside, the button still works the same.
Daily List is a to-do list app. Tom has thirty checks that sign in. Each one finds the sign-in button on its own, by its name on the page. Then Leo renames the button. All thirty checks break at once.
Tom wants a remote for the sign-in page. One small piece of code that knows where the button is. The thirty checks just press sign in. That piece of code is called a .
The picture has limits. A remote is built once by the maker. A page object is code that your team must keep up to date.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 2 in this section
- rewire
- put in new electric wires
- renames
- gives a new name
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Keeping the what of apart from the where, so a change to the page is fixed in one place.
- Name the action
- Put the where in the page object
- Keep the check on top
- Repair in one place
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The remote | The page object |
| A button on the remote | An action such as sign in |
| The wiring inside the television (TV) | The locators and tool calls |
| The person watching | The check that decides if it is right |
WHERE THIS PICTURE STOPS
- A remote is built once by a maker. A page object is code your team must keep up to date.
- Pressing a button always works. A page object can still break when the page changes.
- A remote has a small number of buttons. A page object can grow too big.
HOOK
Press the button, not the wire.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
If thirty checks would break when one button is renamed, the button belongs in one , and the checks just press it.
| In the trick | What it stands for |
|---|---|
| Thirty checks break | All thirty checks break at once when Leo renames the button |
| One page object | One small piece of code that knows where the button is |
| Just press it | The checks just press sign in |
With only a few checks, a page object can cost more to keep up than the repair it saves.
TELL A FRIEND
A remote hides the wiring behind a few buttons. A hides the locators behind a few actions.
OFTEN MIXED UP WITH Locators: finding an element with CSS selectors and XPath. The locators lesson shows how to find one element. This lesson shows where to keep those locators so only one place needs repair.
PRACTISE AND KEEP
Sources for this topic — 9 sources
- Market practice
Page Object (Martin Fowler bliki) ↗ — Martin Fowler · A page object handles the mechanics of finding and manipulating data in a control, and should not contain assertions, which belong to test code (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Page object models (Selenium documentation) ↗ — Selenium · A page object is a class that is an interface to one page, so a user interface change is fixed in one place; one check that the page loaded may sit inside it (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Why Serenity/JS (Serenity/JS documentation) ↗ — Serenity/JS · Screenplay describes actors with abilities who perform interactions, tasks and questions (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Screenplay pattern: a solid alternative to page objects (Caplin blog) ↗ — Caplin Systems · Page object classes grow with every new element and action, and Screenplay is offered as an alternative built on actors, tasks and questions (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Test automation design patterns you should know (Kobiton) ↗ — Kobiton · A facade is a simplified front over a larger body of code. In test code it bundles actions across several page objects so that a test makes one call (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. Blog opinion, not a standard.
- Market practice
Automation testing design patterns (TestGuild) ↗ — TestGuild · Some engineers argue that page objects often break the single-responsibility rule. The Screenplay pattern is offered as an answer that applies the single-responsibility idea and its relatives to acceptance tests (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. Blog opinion, not a standard.
- Market practice
ISTQB Certified Tester Advanced Level Test Automation Engineering (CTAL-TAE) v2.0, certification page ↗ — International Software Testing Qualifications Board (ISTQB) · Mirror copy of the publisher PDF (ISTQB syllabus CTAL-TAE v2.0, 3 May 2024), version checked against the document's own front matter, read in full text: TAE-3.1.5 (K3) apply design principles and design patterns in test automation: the four object-oriented principles (encapsulation, abstraction, inheritance, polymorphism), the five SOLID principles, and the facade, singleton and page object patterns, with the flow model as an expansion of the page object model
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Version 2.0. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
The PageFactory (legacy Selenium 2 documentation) ↗ — Selenium project · r8a-selenium-pagefactory-legacy (helper fills annotated fields, lazy lookup, page marked legacy); selenium-page-object-models. Search excerpt, page not opened.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
ISTQB Certified Tester Advanced Level Test Automation Engineering (CTAL-TAE) Syllabus v2.0 ↗ — International Software Testing Qualifications Board (ISTQB) · Section 3.1.5 (printed page 28): object-oriented principles, SOLID, facade, singleton, page object model and flow model patterns; version 2.0 of 2024-05-03, mirror copy of the publisher PDF, version checked against front matter, opened
Primary publisher body opened and relevant sections read on 6 November 2026; selected-section reading, not a claim every page or external link was read. See docs/research/v16-testing-automation-literacy-audit-20261106.md for exact sections, version and limitations.
V52 additionally read actual publisher PDF7 November 2026: version 2.0,3 May 2024 front/introduction and all substantivechapters 1–8/29 learning objectives, throughprintedp 53 and selectedreferences. Not every appendix or cited book. §3.1.5 says interface substitution; Martin’s original calls it Interface Segregation. Preserve the source discrepancy separately. No unrestricted commercial image permission established.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.