Implementing the Page Object model in Ruby by using the page-object gem

While developing tests in Ruby, we can use the page-object gem for implementing the Page Object model within the tests. The page-object gem provides simple features for building the objects of a Page Object along with Watir-WebDriver.

In this recipe, we will see how to use the page-object gem for implementing the Page Object model for the BMI Calculator's main page.

Getting ready

You need to download and install the page-object gem with the help of the following command:

gem install page-object

How to do it...

For implementing the Page Object model in Ruby using the page-object gem, perform the following steps:

  1. Define a class for the Page Object model by creating a Ruby script ...

Get Selenium Testing Tools Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.