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:
Define a class for the Page Object model by creating a Ruby script with the name of the page. In this example, we will be creating a Page Object model for the main page of the BMI Calculator application and including the page-object module:
require 'page-object' class BmiCalcPage include PageObject text_field...