Page Object Model vs Screenplay Pattern
The Page Object Model puts each page in a class that owns its locators and exposes user actions, so a UI change is fixed once. The Screenplay Pattern models actors who perform tasks made of interactions and ask questions, composing behaviour instead of inheriting it. Choose page objects for most suites; choose Screenplay once page objects become god classes.
- Page Object Model
- A design pattern where each page or component of the application is a class that owns its locators and exposes the actions a user can take there.
- Screenplay Pattern
- A design pattern where actors with abilities perform tasks composed of interactions and ask questions about the application's state.
How do Page Object Model and Screenplay Pattern compare?
| Dimension | Page Object Model | Screenplay Pattern |
|---|---|---|
| Unit of organisation | Page Object ModelThe page or component: one class per screen | Screenplay PatternThe actor and the task: what a user is trying to do |
| How behaviour is built | Page Object ModelMethods on the page class; reuse through inheritance and helper classes | Screenplay PatternComposition: tasks made of smaller tasks and interactions, run with actor.attemptsTo(...) |
| Where assertions live | Page Object ModelIn the test, never in the page object, apart from checking the page loaded | Screenplay PatternIn the test, as questions the actor asks about the application state |
| Readability of a test | Page Object ModelReads as a sequence of page interactions | Screenplay PatternReads as a business narrative: who does what to achieve which goal |
| Learning curve | Page Object ModelLow; the pattern most tutorials and teams already use | Screenplay PatternHigher; more classes and concepts before the first test runs |
| Failure mode | Page Object ModelPage classes grow into thousand-line god objects mixing navigation, actions and data | Screenplay PatternOver-abstraction: a task for every click and a class explosion nobody wanted |
| Tooling | Page Object ModelSupported everywhere; Selenium's docs describe it and Playwright fixtures fit it | Screenplay PatternSerenity BDD and Serenity/JS provide the pattern as a library for Java and JavaScript |
| Interview expectation | Page Object ModelExpected knowledge for any automation role | Screenplay PatternBonus knowledge; mostly asked in BDD-heavy or Serenity-based teams |
When should you choose Page Object Model, and when Screenplay Pattern?
Choose Page Object Model when
- The suite is small to medium and a class per page keeps it navigable.
- The team knows the pattern and the tooling, tutorials and hiring pool assume it.
- You are using Playwright or Cypress, whose fixtures and commands already keep tests short.
- You want the lowest barrier for new joiners to write a test.
Choose Screenplay Pattern when
- Page objects have become large, duplicated and hard to change safely.
- Tests should read as user goals for business stakeholders, especially alongside Cucumber.
- The same steps are reused across many user journeys and composition beats inheritance.
- The team uses Serenity BDD or Serenity/JS, where the pattern is provided rather than hand-built.
How does Page Object Model vs Screenplay Pattern come up in QA interviews?
Framework design questions separate candidates who have maintained a suite from those who have only added tests to one. The interviewer wants to hear the failure mode of page objects from experience, and a judgement about when the extra structure of Screenplay is worth its cost.
- 01Describe the Page Object Model and the rule about assertions. Why does that rule exist?
- 02Your page objects have grown to 1,500 lines each. What went wrong, and would Screenplay have prevented it?
- 03Explain actors, abilities, tasks, interactions and questions with a login example.
- 04How would you introduce Screenplay into an existing page-object suite without a rewrite?
No account needed · Scored in under a minute against a senior rubric
Common questions about Page Object Model vs Screenplay Pattern
Is the Page Object Model still relevant?
Yes. It remains the default structure for most automation suites, is described in Selenium's own documentation, and maps naturally onto Playwright and Cypress projects. Its weaknesses appear at scale, when page classes accumulate unrelated responsibilities; that is the problem Screenplay was proposed to solve.
Is Screenplay a replacement for page objects?
It is an alternative that grew out of the page object idea. Screenplay keeps locators and low-level interactions but organises tests around actors and tasks composed from smaller parts, rather than around pages. Many Screenplay codebases still keep a lightweight page or component layer for locators.
Which tools support the Screenplay Pattern?
Serenity BDD provides Screenplay for Java, working with JUnit 4 and 5 and with Cucumber, and Serenity/JS provides it for JavaScript and TypeScript, integrating with test runners such as WebdriverIO. You can hand-build the pattern in any language, which is how it started.
Which should I learn for QA interviews?
The Page Object Model, thoroughly, including the assertion rule and how methods return other page objects. Read about Screenplay so you can explain actors, tasks and questions and say when you would reach for it; being able to describe its trade-offs is what senior interviews reward.
Ready to be asked about Page Object Model or Screenplay Pattern?
Practice explaining the trade-off to an interviewer who knows both.
Join 500+ QA engineers already practicing with AssertHired.
A test passes locally but fails in CI about one run in five. Walk me through what you check first, and why.
Scored on the same four dimensions as the real thing: Technical accuracy · Coverage · Clarity · Best practices.
Rather skip ahead? Create a free account