Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6728347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:09:34+00:00 2026-05-26T10:09:34+00:00

In a nutshell, what I need is to create a Scenario Outline with a

  • 0

In a nutshell, what I need is to create a Scenario Outline with a step that is repeatable without having to type it in using multiple AND’s as I am currently doing below:

Scenario Outline: outline
    Given I am a user
    When I enter <x> as an amount
       And I enter <x2> as an amount
    Then the result should be <result>
Scenarios:
    |x|x2|result|
    |1|2 |3     |
    |1|0 |1     |

However, I would like to do something like the following:

Scenario Outline: outline 
    Given I am a user
    When I enter <Repeat: x> as an amount
    Then the result should be <result>

Scenarios:
    |x    |result|
    |1,2,3|6     |
    |1,2  |3     |

Basically, I want the “I enter as an amount” to run 3 and 2 times respectively.

The closest I have found to this question is How do I re-run a cucumber scenario outline with different parameters? , but I wanted to double check before giving up and using a StepArgumentTransformation with a comma separated list or something similar.

The final answer that I went with is something more like this:

Scenario Outline: outline 
    Given I am a user
    When I enter the following amounts
        | Amount1 | Amount 2| Amount3|
        | <Amt1>  | <Amt2>  | <Amt3> | 
    Then the result should be <result>

Scenarios:
    |Amt1 |Amt2 |Amt3 |result|
    |1    |2    |3    |6     |

There does not seem to be a good way to leave a value blank though, but this is pretty close to the solution I was looking for

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:09:34+00:00Added an answer on May 26, 2026 at 10:09 am

    The Examples keyword:

    Scenario Outline: outline
        Given I am a user
        When I enter <x> as an amount
        Then the result should be <result>
        Examples:
            |x|result|
            |1|3     |
            |1|1     |
    

    Is for when you want the entire test to take different parameters. It sounds like you want to feed repeating parameters at the When step.

    The easier approach that won’t require implementation of a StepArgumentTransformation is to simply use a table in the when:

    When I enter the following amounts
    |Amount|
    |2     |
    |3     |
    |4     |
    

    Then simply iterate all the rows in table to get your arguments. This avoids needing to have an interim method for the transformation.

    Alternatives include using more steps or by parameter parsing, so as you say, use the StepArgumentTransformation.

    Of course, if you need to test multiple repeating items, you could use both StepArgumentTransformation and Examples: feeding in a comma-list of numbers:

    Examples:
    |x    |result|
    |1    |1     |
    |1,2,3|6     |
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using LinqKit PredicateBuilder (http://www.albahari.com/nutshell/predicatebuilder.aspx) for a method that do searching. This is how
OK, I have a somewhat complicated system in C++. In a nutshell, I need
In a nutshell, I have a solution that builds fine in the IDE, and
My controller, in a nutshell is this: chart1.SeriesCollection.Add(SC); using (MemoryStream ms = chart1.GetChartStream()) {
Here are the specs that I'm trying to implement in a nutshell: 1) Some
I'm making a task-based program that needs to have plugins. Tasks need to have
Possible Duplicate: Why we need Thread.MemoryBarrier()? From O'Reilly's C# in a Nutshell: class Foo
In a nutshell: Using jquery I want to get some xml output and use
I need to write a function that takes 4 bytes as input, performs a
I am trying to dynamically create a linq expression at runtime using PredicateBuilder from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.