QA Automation Engineer interview question

When would you use Page Object or Screenplay?

Page Object fits page-centered flows by encapsulating locators and actions; Screenplay fits complex cross-page domains by composing actor abilities and tasks. Choose the simpler model that keeps intent readable and UI details localized.

Direct answer

What a strong answer covers

How it works

Page Object wraps each page or component in a class that owns its locators and exposes actions such as login or addToCart, so tests read as user steps and a UI change is fixed in one place. It fits applications where flows map cleanly to pages. Screenplay models actors with abilities performing tasks composed of interactions, which scales better when the same business task spans many pages, several user types, or both UI and API, at the cost of more abstraction to learn. The choice is the simplest model that keeps the test intent readable and keeps UI detail out of the test body; mixing both in one suite is a common source of confusion.

Example

A marketing site with ten pages uses Page Objects: LoginPage.login(user) and CheckoutPage.submit() cover the flows and a redesign of the header touched one class. A banking platform with a dozen user roles and workflows that cross web, mobile web, and API moved to Screenplay: the task ApproveTransfer is performed by an actor with BrowseTheWeb or CallAnApi abilities, and the same task definition runs through either channel.

Common mistakes

  • Putting assertions and test logic inside page objects.
  • Adopting Screenplay for a small app and spending more time on the framework than on tests.
  • Letting locators leak into test files so every UI change breaks dozens of tests.

A useful answer structure

Answer from your own work.

Do not memorise a script: use only examples you can explain honestly in follow-up questions.

Practise this answer with MiraHint

Open the desktop workspace and rehearse a clear answer in your own words.

Download MiraHint
QA Automation Engineer interview questions