Mohit Talreja
Mohit Talreja

Reputation: 68

How can I skip one or multiple examples under Scenario Outline Examples for Specflow

I have scenario outline example and i want to skip for one or more example

Scenario Outline : 
 Given user is using <app>
 Then user is logged in 
 Examples: 
          |app  |
          |test |
          |local|

How can i skip the run for 'test' here ?

Using specflow - 3.* with nunit as runner

Thanks for your help!!

In Step Def File

If(app=="test")
  //skip the run for this condition
else
  run for others

Upvotes: 1

Views: 640

Answers (1)

sbridewell
sbridewell

Reputation: 1140

Put a # at the beginning of the example line that you want to skip, e.g.

#           |test |

If you're using Visual Studio then you can skip multiple examples by highlighting them and then holding down the Ctrl key and pressing K and then C (same as commenting out lines of code in any other language).

Upvotes: 1

Related Questions