BDD Testing using Cucumber and Selenium Ruby

Behaviour-Driven Development (BDD) has become a well established approach to testing, providing ‘living documentation’ of the system under test, and being able to use the documentation to drive the test automation. Our BDD courses teach you what BDD is all about, how to write your Gherkin Feature files, and then how to bind the test automation code to the features. To learn more about BDD visit this page.

The perfect introductory course on Behaviour-Driven Development using Selenium WebDriver Ruby for Test Automation. This course covers writing Feature Files in Gherkin, then generating Step Definitions and then writing the code bindings using Selenium WebDriver Ruby. It is a very comprehensive course covering Cucumber as well as Selenium, and it even covers an introduction to API testing using Ruby.

Technologies Used

This course uses Cucumber Ruby, WebDriver Ruby, RSpec all in Microsoft Visual Studio Code or RubyMine (your preference).

Course Delivery

The course is delivered online. It is live, instructor-led training over 5 days. Each day is an online session of approx. 3.5 hours. All delegates receive a comprehensive workbook, and the sessions are recorded. It can be accessed from anywhere in the world. We also offer on-site training at your offices if required.

Course Overview

Installation of the Cucumber Framework

Installing RubyMine, Ruby, Selenium WebDriver, Cucumber, Capybara, RSpec

Ruby Programming Primer

Variables, Loops, Conditional Statements, Arrays, Hashes, Methods, Classes and Modules

Introduction to WebDriver & Capybara

HTML overview, understand what Selenium WebDriver is and how Locators work. Learn how the Capybara framework sits on top of WebDriver, Capybara’s Locator strategies & DSL

Introduction to BDD

A background to BDD and its benefits. The process of BDD. An overview of the tools available, terminology.

Introduction to Gherkin

Feature Files, introduction to the Gherkin language, basic syntax

More Gherkin

Using the Background fixture, Parameters, Doc Strings, Examples and Data Tables, using Tags to organise execution, commenting

Step Definitions & Code Binding

Using prototype step definitions, creating step definition Methods, expanding Methods with Parameters, Step Definition syntax, using Regular Expressions

Tables & Scenario Outlines

In-line Step Table Iterating, Scenario Outline Data Handling


Using Hooks in cucumber-Ruby (Before, After), Cucumber Timeouts

Execution & Reporting

Using Tags to filter Scenarios, Using Cucumber Command Line Interface, Results & Reporting, HTML reports

API Testing

Integrating HTTParty into the Cucumber framework, practical examples.

VS Code Tips (unless using RubyMine)

Cucumber Icon Packs, setting up GoTo Definitions Shortcut, Debugging scripts