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

Using Capybara, Cucumber, and Selenium WebDriver in Ruby

Capybara is an acceptance test framework for web applications in Ruby. It integrates with Ruby-based BDD frameworks such as Cucumber and RSpec along with Selenium WebDriver for web testing capabilities. Capybara is widely used in testing Rails applications.

In this recipe, we will see how to use Capybara, Cucumber, and Selenium to test BMI Calculator application.

Getting ready

  1. You need to install Capybara Gem by using the following command:
    gem install capybara
    
  2. Additionally, you also need to install Cucumber and RSpec Gem on a fresh Ruby installation, as follows:
    gem install cucumber
    gem install rspec
    

How to do it...

In Capybara, we need to create a features file for the stories under test. ...

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