Skip to main content
Automation
DEFINITION

What is Screenplay Pattern?

The Screenplay Pattern is a test automation design pattern that models tests as Actors who have Abilities and perform Tasks and ask Questions, favoring composition over the inheritance-heavy Page Object Model.

Free to start · 7-day trial on paid plans

IN DEPTH

In depth.

The Screenplay Pattern (popularized by Serenity BDD) reframes a test from the system's perspective to the user's. An Actor (for example "Tracy") is given Abilities such as BrowseTheWeb or CallAnApi. The actor performs Tasks ("AddItemToCart"), which are built from lower-level Interactions ("Click", "Enter"), and verifies outcomes by asking Questions ("the cart total"). Assertions read fluently: actor.should(seeThat(theCartTotal, equalTo("$42"))).

Compared with the Page Object Model, Screenplay solves POM's tendency to grow into bloated, multi-responsibility page classes. Because behavior is composed from small, single-responsibility tasks and interactions, code reuse is high and the SOLID principles are easier to honor. The trade-off is a steeper learning curve and more upfront boilerplate, which is why it is usually reserved for large, long-lived suites maintained by experienced automation engineers.

It is available in Serenity/JS, Serenity BDD (Java), and ports for other ecosystems, and it pairs naturally with BDD because tasks map cleanly to business-level steps.

WHY IT MATTERS

Why interviewers ask about this.

Senior automation and SDET interviews use Screenplay to separate candidates who only know Page Objects from those who understand design trade-offs, composition over inheritance, and how to scale a suite without it becoming unmaintainable.

EXAMPLE

Example scenario.

A 4,000-test Page Object suite has page classes with 40+ methods that mix navigation, assertions, and business logic. The team migrates high-churn flows to Screenplay: reusable tasks like Login and Checkout compose from small interactions, duplication drops, and new scenarios read like business steps instead of method soup.

TIP

Interview tip.

Frame Screenplay as a response to Page Object Model pain at scale. Name the building blocks (actors, abilities, tasks, interactions, questions) and be candid about the trade-off: more power and reuse, but more complexity than POM needs for small suites.

FAQ

Frequently asked questions.

Is the Screenplay Pattern better than the Page Object Model?

Not universally. Screenplay scales better for large, long-lived suites through composition, but it adds complexity and a learning curve. For small or short-lived suites, the Page Object Model is often the pragmatic choice.

Which tools support the Screenplay Pattern?

Serenity BDD (Java) and Serenity/JS are the best known, and there are ports and libraries for other ecosystems. It works on top of WebDriver, Playwright, and API clients.

FREE TOOLS  /  no signup

Free QA career tools, no account needed

Instant and private, everything runs in your browser. Try them before you sign up.

EXEC.NOW

Ready to Ace Your QA Interview?

Practice explaining screenplay pattern and other key concepts with our AI interviewer.

Join 1,200+ QA engineers already practicing with AssertHired.

Start your free QA interview
FREE.TO.START  ·  7.DAY.TRIAL ON PAID PLANS
Written by Aston Cook, Senior QA EngineerLast updated May 2026