Based from Gherkin Reference, the Scenario Outline keyword can be used to repeat the same steps with different values or arguments being passed to the step definitions. In our previous post, we learned how to create scenario outline that can be used to repeat the same steps with different parameters.In this tutorial, we will show you some Cucumber Data Tables Example in Java and how it differs in Scenario Outline and how you can implement it in your Test Cases. Cucumber came with a solution for reducing this effort by using the concept of Scenario Outline coupled with Examples. In our previous post, we learned how we can start creating Cucumber for our test.In this post, we will learn what is cucumber scenario outline and an example on how it works. When do we use Scenario outline. Aside from Enum it supports conversion to BigInteger , BigDecimal , Byte , Short , Integer , Long , Float , Double and String . DataTables are also used to handle large amount of data. Cucumber comes with a built-in object mapper that can handle most basic types. Let's continue with an example where a two-column data table is converted into a Map. Give the file name such as “outline.feature” Write the following text within the file and save it. Scenario Outline − Login functionality for a social networking site. Scenario: eat 5 out of 12 Given there are 12 cucumbers When I eat 5 cucumbers Then I should have 7 cucumbers Scenario: eat 5 out of 20 Given there are 20 cucumbers When I eat 5 cucumbers Then I should have 15 cucumbers We can collapse these two similar scenarios into a Scenario Outline. "Scenario Outline" is a keyword, if a test needs to be executed for more than one test data set it will be marked as "Scenario Outline" instead of "Scenario". It starts with scenario and then gets completed with scenario outline. Feature − Scenario Outline. Data Tables in Cucumber are quite interesting and can be used in many ways. Scenario states the general point of test in more abstract way. That leads to another question. Filed under: Cucumber, Programming, — Tags: BDD, Behaviour Driven Development - BDD, Cucumber, Cucumber DataTable, Cucumber-jvm, DataTable, JUnit, Java, Maven, Test automation — Thomas Sundberg — 2014-06-30 Cucumber has a nice feature that will help you to use tables in your scenarios. Cucumber data table is one of the most commonly used methods for passing test data from feature files to your test scripts. Scenario outlines allow us to more concisely express these examples through the use of a template with placeholders, using Scenario Outline, Examples with tables and < > delimited parameters. In our previous article, you saw how we can pass string and numeric data from feature files, which Cucumber simply treats as variables. They are quite powerful but not the most intuitive as you either need to deal with a list of maps or a map of lists. Background in Cucumber is used to define a step or series of steps that are common to all the tests in the feature file.It allows you to add some context to the scenarios for a feature where it is defined. You can learn more from Cucumber help . For example, when we have 20 scenarios that can be combined as 1 scenario outline, it looks better and simple. I'd recommend you stay away from them. Cucumber came with a solution for reducing this effort by using the concept of Scenario Outline coupled with Examples. Most of the people gets confused with Data tables & Scenario outline, but these two works completely differently. The Scenario Outline can be used to run the same Scenario multiple times, with different combinations of values. So, we usually write a feature file as below. These values are stored in the Examples table. Since the beginning, we have been taking an example of login functionality for a social networking site, where we just had two input parameters to be passed. Cucumber Scenario data table and Scenario Outline data table 1. In the below section, we will try to take up … Aside from Enum it supports conversion to BigInteger , BigDecimal , Byte , Short , Integer , Long , Float , Double and String . Cucumber data tables. They are quite powerful but not the most intuitive as you either need to deal with a list of maps or a map of lists.Most of the people get confused with Data tables & Scenario outline, but these two works completely differently. The Scenario Outline steps provide a template which is never directly run. However, its hard to have test coverage (positive and negative scenarios) with just 1 or 2 scenarios per spec file. Cucumber 3 supports a few more types (String, Integer, Float, Double, Byte, Short, Long, BigInteger, and BigDecimal). Cucumber Scenario Outline in Gherkin. While working on automation, we may face variety of scenarios.