Site Loader
Auckland, New Zealand

Post Author: Karthik kk

7 Replies to “Specflow – Working with Scenario Outline”

  1. Good day, Karthik!

    Do you know ho to implement something like that:

    Given I have run the
    |application|
    |app 1 |
    |app 2 |
    Then bla bla bla and

    Examples:
    |value1|value2|
    |1 |2 |
    |2 |1 |

    In total we should have 4 test, or 2 test but each test makes two checks.

  2. Thanks for you response, but it seems my question need more info.
    I’m using Specflow for Coded UI tests.

    Scenario Outline: Test Login page layout.

    Given I’m logged by and
    |username|password |
    |user1 |password1|
    |user2 |password2|
    Then I want be sure that is
    Exampes:
    |control |state |
    |control1|visible |
    |control2|enabled|

    So in the end I like to see 4 test after build the project, but i think is not possible (I hope i’m wrong).
    Any way I want to do actions from step two for first user and then for second user.

    Total 4 tests.

    1. I think you cannot control the execution flow, by directly going to step 2, but still you can do some C# code to get in there.

      And you are right, you will never see 4 tests after build.

      Thanks,
      Karthik KK

  3. Is there any way to normalize my scenario outline if we have 100+ parameters. I mean, we need to pass 100+ parameter in scenario outline in example then its not looks good. so can i access all those data in step definition from excel without passing all data from scenario outline.
    Ex.
    @source:Data.xlsx:Sheet2
    Example:
    |Parameter1||Parameter1||Parameter1||Parameter1||Parameter1||Parameter1||Parameter1|…………………..up to 100.

  4. Hi,

    I am using .net core V2.2 and i am trying to add Specflow excel extension but it is not working. please suggest me on this

  5. Hi Karthik,

    Is there a way we can add parameter to Scenario Outline: as in

    Scenario Outline: Checker Whether Calculator is Working properly
    Given Calculator Application Is Open
    Then Keyed In
    And Keyed In
    And Clicked
    And Result Is ToBe

    Examples:
    | testcaseId | firstparamer | secondparameter | mathoperator | result |
    | 1 | 10 | 2 | + | 12 |
    | 2 | 10 | 4 | – | 6 |
    | 3 | 10 | 8 | * | 80 |

    I am using C#, Specflow 3.3.30 with extentreport using dotnet core.

    The testcaseId is not even identified as a parameter in Scenario Outline section. I tried looking for in the Specflow git (there is even a post on this but not given a resolution – https://github.com/SpecFlowOSS/SpecFlow/issues/1432).

    Any help would be greatly appreciated.

Leave a Reply to Prashant Cancel reply

Your email address will not be published. Required fields are marked *