O'Reilly logo

Selenium Testing Tools Cookbook - Second Edition 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

Creating a data-driven test in Ruby using Roo

In the previous recipes, we saw parameterization with Java and .NET. Ruby has also been used widely to create Selenium WebDriver tests.

Again, Ruby does not have its own way to parameterize the script. However, we can use the Roo (http://roo.rubyforge.org/) gem in Ruby to read spreadsheets. Roo supports multiple formats, as follows:

  • A locally stored Excel (.xls) file
  • A locally stored OpenOffice (.ods) file
  • An Excel file (.xls) stored in a Confluence wiki page with Confluence Office Connector
  • A Google Docs spreadsheet

Roo is a great alternative to the Ruby Excel COM WIN32 API, as it does not need Excel or OpenOffice installed on the machine. It reads both these files natively.

In this recipe, we will parameterize ...

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