Flaws in the Page Object Model?


  • QA Engineer

    I read this article about flaws in the Page Object Model/POM, authored by a lady at ThoughtWorks - https://blog.getgauge.io/are-page-objects-anti-pattern-21b6e337880f

    She says that POM leads to excess code and maintainability issues. For example, she goes against the general recommendation that Page Objects/POs should return other POs - See the content under the heading "Method chaining".

    Are these arguments sound ? Are there any genuine flaws in the POM ?



  • I think if you stick to simple PageObjects as described by Martin Fowler it is fine. It should be a simple abstraction to keep your test-code DRY, reusable and increase readability by using page-methods that describe behaviour of the page/view.

    The linked article is mainly about issues with Page Factories and thinking PageObjects have to return another Page (they don't, but sometimes it is very handy!). Personally I have never seen a use for PageFactories, they do magic stuff I don't need, are verbose, etc.. Nor do I see the need for an extra Step layer that the suggested Guage adds. For me that is similar overhead and introduces other pains.

    Just keep it simple, and only add complexity when you need it.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2