热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

Chapter 6

Data Tables, Scenario Outlines, Examples, and Parameter-Driven Test Design

Write expressive, reusable scenarios that cover multiple variations without duplicating entire feature files.

Inside this chapter

  1. Scenario Outline
  2. Data Tables
  3. When to Use Which
  4. Advanced Guidance

Series navigation

Study the chapters in order for the clearest path from beginner BDD concepts to advanced automation architecture. Use the navigation at the bottom of each page to move through the full tutorial series.

Tutorial Home

Chapter 6

Scenario Outline

Scenario Outline: User logs in with different credentials
  Given the user is on the login page
  When the user enters username "<username>" and password "<password>"
  Then the message "<message>" should be shown

Examples:
  | username | password | message            |
  | valid    | secret   | Welcome back       |
  | invalid  | wrong    | Invalid credentials |

Scenario outlines are ideal when the behavior is the same but input variations differ. They reduce duplication while preserving readability.

Chapter 6

Data Tables

Data tables allow structured input to be passed to steps, which is useful for forms, item lists, configuration values, and batch-like scenario data.

When the user fills the registration form
  | name  | Riya              |
  | email | riya@example.com  |
  | city  | Kolkata           |
Chapter 6

When to Use Which

Use scenario outlines when the whole scenario repeats with different examples. Use data tables when one step needs structured input. Good Cucumber authors know the difference and choose the approach that keeps scenarios easiest to read and maintain.

Chapter 6

Advanced Guidance

Parameterization is helpful, but too much parameterization can make scenarios abstract and less readable. The goal is not maximum reuse at all costs. The goal is clear, executable behavior examples.

版权所有 © 2026,WithoutBook。