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
-
Seems there is one alternative: Screen-play Pattern: sqa.stackexchange.com/questions/27488/… (I don't have enough information yet to provide a real answer)Niels van Reijmersdal– Niels van Reijmersdal2017年05月30日 13:59:37 +00:00Commented May 30, 2017 at 13:59
-
And another one similar or the same as the Screen-play one, it is called the Journey pattern, this page explains it pretty well: fasterchaos.svbtle.com/journey-patternNiels van Reijmersdal– Niels van Reijmersdal2017年05月30日 14:34:58 +00:00Commented May 30, 2017 at 14:34
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
-
Thanks, very interesting. Maybe you can gives us a summary of the insights and details of the challenges you had with the Page Objects in this question: sqa.stackexchange.com/questions/13426/… :)Niels van Reijmersdal– Niels van Reijmersdal2015年06月12日 11:57:59 +00:00Commented Jun 12, 2015 at 11:57