16 Aug 2012, 18:57

Chuck van der Linden (3 posts)

a useful approach for web automation is the use of a page object model it can increase the code readability and also provides a good abstraction layer that gives you a single place to update if UI changes require code updates

There are some existing gems for this, but it’s pretty easy also to roll your own with not too much code

21 Aug 2012, 04:58

Ian Dees (195 posts)

Hi, Chuck.

We were toying with the idea of writing about Kookaburra, which uses the Window Driver pattern–not exactly the same as page objects, but somewhat related. Do you have an example of the style of API you’d like to see?



27 Aug 2012, 03:01

Dean Cornish (5 posts)

Personally I love em’, and it doesnt matter whether you’re doing web, web services, UI, or a mix - they make a nice way to abstract out the heavy lifting tool. The one thing I’d be curious to know is- from Aslak’s point of view- what his take is on the Cucumber side.

Background: When I first started using Cucumber- I paired with a developer and we put aside everything we thought we knew and focused on understanding the intent of cucumber and implement things the way it was seemingly intended- which is Cucumber as a DSL creating tool- and runner. So we created a library of steps that did the work for us- with an absolutely naive way of thinking eg. steps calling other steps etc. Great learning experience- but at the same time lead to some nasty patterns.

I wonder if this is the way Aslak intended and how they’d work with page objects or other abstraction patterns, what he finds works, and why.. etc. :)

28 Aug 2012, 21:31

Matt Wynne (85 posts)

Page objects are OK, but they still encourage you to focus on implementation details about your user interface rather than the behaviour you’re getting from using that user interface.

We wrote about this quite a bit in The Cucumber Book, and I’m hoping we’ll have a chapter in Cucumber Recipes on using different World implementations to drive your application at different levels from the same scenarios. The chapter ‘Refactor to Extract Your Own Application Driver DSL’ touches on this same subject and describes the kind of abstractions I like to see.

  You must be logged in to comment