Skip to content
Preptima
easyConceptCodingEntryMid

What belongs in a page object, and what should never go in one?

5 min readUpdated 2026-08-15

Answer

Short answer

A page object owns locators and the mechanics of interacting with a screen, and nothing else. Assertions, test data and workflow belong in the test, because the moment a page object asserts, the test's intent stops being readable from the test.

Mention test automation where it changes the risk, the owner, or the next check. A useful test automation point should make the answer more testable, not merely longer. Tie test automation back to the scenario so the interviewer can see why it matters here.

Was this answer helpful?

Likely follow-ups

  • Your login method asserts the dashboard loaded. What breaks about that?
  • Where does a multi-page checkout flow live if not in a page object?
  • How do you choose a locator that survives a front-end rewrite?
  • When would you not use page objects at all?

Related questions