O'Reilly logo

Selenium Testing Tools Cookbook by Unmesh Gundecha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required