I was wondering if there are alternative patterns for the Page Objects pattern.

What possible design patterns are there for automated GUI testing?

Looking for:

  • Description and pro's and con's
  • Simple usage example
  • Sources e.g. Blogs, whitepapers...
  • Best practises

1 Answer 1


I had similar question few years back. At that point I had only seen page object based implementation. In my current company we have a single framework that manages mobile, web, web services.

A nice presentation of page object challenges is available in http://www.slideshare.net/abagmar/perils-of-pageobject-pattern. There is also a youtube session on the same

Some of Page Object Challenges are

  • Duplication of Code for Data heavy validations (Reusing similar / validations)
  • Maintenance & Scaling Challenges
  • Multiple frameworks for Mobile, Web etc is hard to manage

We have a Reference Pattern (Similar to Business layer page object pattern in slides)

  • Custom API Drivers for Web Driver, Selenium or other drivers
  • Common utility, data, database service, web service classes
  • For Mobile, Web with reuse of utilities, data, DB access, Web Services, You have page object, template design pattern, factory design pattern during implementation. This really depends on situation and need. It also evolves over period of time.
  • Website can pass / manage session state with session_id, cache variables etc, similarly when we move across pages we create a parent object and store required state of values, when we move to next successive page, we use those states / values in related pages / actions. This is something advanced concept that really makes frameworks mimic http state / session state etc...

I'm working on example code for this explanation. I will share it in Github soon


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.