The Screenplay Pattern: Better Interactions for Better Automation

The Screenplay Pattern is a design pattern for automating interactions. It helps you write more readable and maintainable tests. It can be used not only for UI tests but also for Web UI, REST API, mobile, and so on. It is more scalable and reusable for large test automation projects when compared to raw calls or using page objects.

Our guests on this episode:

Andrew Knight is the “Automation Panda” – an engineer, consultant, and international speaker who builds solutions for software testing problems. He has designed and built robust test automation projects for operating systems, service APIs, and Web apps with thousands of tests running continuously. He is the lead developer for Boa Constrictor, the .NET Screenplay Pattern. He also mentors people in good development, testing, and BDD practices. Andy currently works full-time as the Lead Software Engineer in Test at PrecisionLender, a Q2 company. He is a technical blogger and writes on

Show notes:


Defining Interactions


Simple DuckDuckGo Search Test


Why is it so hard to automate interactions


Raw WebDriver Calls


Implicit Waits


Explicit Waits


Duplicate Code


Unintuitive Code


Page Object Pattern


Page Object Pattern Usage


Page Object Duplicate Redux


A Base Page


Base Page Inheritance


Page Objects are free-form


Reconsidering Interactions


Learn How to Screenplay


Boa Constrictor


Rewriting DuckDuckGo Search Test using Boa Constrictor


Required packages


Creating the actor


Adding abilities


Modeling Web Pages


Attempting a Task


Asking a question


Composing a custom Interaction


Waiting for questions to yield answers


Quitting the Web browser


A completed test

Actors use abilities to perform interactions!


SOLID principles


Why Use Screenplay?


Does Screenplay provide better interactions for better automation?


Getting started with Screenplay


Q & A section

Show links

Andrew Knight