Watir-page-helper has been end-of-lifed


I am happy to announce that the watir-page-helper gem has been end-of-lifed: meaning no further development will happen on it and it will remain as it stands. I am thoroughly supportive of Cheezy’s page-object gem and recommend you move onto this when you have the first opportunity to do so.


When I initially released this gem, Cheezy had yet to release his page-object gem. I borrowed a lot of his concepts and packaged them into a gem specifically for watir-webdriver. A few weeks later, Cheezy released his page-object gem that not only supports watir-webdriver, but also selenium-webdriver. He has iterated faster than I have and his gem has come along way to support additional features such as defining page-routes and default data. I have supplied a couple of tiny pull requests to him and there is nothing now that watir-page-helper can offer that page-object can’t, so I am EOL’ing watir-page-helper.

So how do I change to use page-object instead of watir-page-helper?

I converted an existing suite of tests that use watir-page-helper to run against Etsy to use the page-object gem (link to tests). It was a fairly straightforward task, and here are the fundamental differences:

  • Accessing an actual element object is done via an _element suffix: for example, defining a link :home, provides a home_element method. Watir-page-helper provided a home_link method, and I prefer Cheezy’s approach (the home_link method is actually supported by page-object but you should move away from it).
  • Watir-page-helper supported p,li,ol as methods, but these are defined as paragraph, list_item, and ordered_list in page-object.

Using Cheezy’s Page Factory

One of the neat features of the page-object gem is the page factory. This is a way to conveniently access pages from Cucumber steps and the like.

There are a couple of things you need to do:

In env.rb, you should mix in the PageObject::PageFactory module

require 'page-object/page_factory'

You then have access to helper methods to visit and set the page you want to use (originally there were just visit_page, and on_page, but I added on and visit – I think they read nicer):

visit_page RegistrationPage
on_page HomePage
visit HomePage
on HomePage


Good things come to an end and get replaced by even better things. Here’s to your future success using the page-object gem.

Author: Alister Scott

Alister is an Excellence Wrangler for Automattic.

5 thoughts on “Watir-page-helper has been end-of-lifed”

  1. You’re a very good man! Keeping newbies from having to choose between the 2. Both are excellent work, btw. Thank you.


  2. Hi Alister,
    I work for taller.net.br and we are using your greate Etsy framework example for our gherkin tests. Today I was asked for changing the folder’s structure. The new arrangement would place features, steps and pages side by side. It would be something like: my_project/features, my_project/steps, my_project/page. The root of the framework would stay bellow my_project, So, it would be, for example, tests/my_project, tests/cucumber.yml, tests/Gemfile, etc. What do you think? Would this impose some restriction? This was asked me for the aim of giving independent folders for each project that could be added under the same file structure and/or repository. So, my two questions are: 1. Would this be good? 2. Any guidelines for doing it?


  3. Thank you for the answer. I still have another question. Do you have any hints on how to dynamically create classes of pages for using them in the steps? I’m trying to figure this because I would like to use labels for finding form ids. The first action is simple:
    field_id = page.label_element(:text=>field_label).html.inspect.scan(/\\”([^\\]*)\\/).first
    But now I would need to send field_id for the _page.rb, but it has already run. So, I thought on solving this dynamically creating a new class, even inside the _steps.rb that would use it. What do you think? Sounds reasonable?


Comments are closed.