Warning: fopen(/tmp/SghXTngBZPli-lDOp8d.tmp): failed to open stream: Disk quota exceeded in /home/executea/public_html/blog/wp-admin/includes/class-wp-filesystem-ftpext.php on line 139

Warning: unlink(/tmp/SghXTngBZPli-lDOp8d.tmp): No such file or directory in /home/executea/public_html/blog/wp-admin/includes/class-wp-filesystem-ftpext.php on line 142
Site Loader
Auckland, New Zealand
In this post we will discuss working with Specflow+Excel plugin of Specflow. We have already discussed a lot about Specflow and their features which you can checkout from here as articles and here as videos

Specflow+Excel

  • SpecFlow+ Excel is a SpecFlow plugin that allows you to define requirements and example sets in Excel files. These requirements can be used in a same way as normal plain text Gherkin feature files.
  • There are two ways to use the Excel files to extend your specifications:
  • Define an entire feature file in Excel using the worksheets as scenarios
  • Extend scenario outline examples in normal plain text feature files with Excel tables
    Here is the scenario we are going to create (Note: Source tag @Source)
Here is the complete video of the above discussion Thanks for reading the post and watching the video!!! Please leave your comments and let me know if there is anything I should update in this post. Thanks, Karthik KK

Post Author: Karthik kk

9 Replies to “Working with Specflow+Excel (Video series)”

  1. Which way to use the Excel files is better ?
    Define an entire feature file in Excel using the worksheets as scenarios or
    have scenario outline examples in normal plain text feature files and store examples in Excel tables?

    1. I think defining in normal plan feature file is better compared to excel, since the whole intention of scenarios is to ensure all the business data is readable for feature file itself.

      Thanks,
      Karthik KK

  2. Hi Thanks for the video and it is very good. I tried but it is throwing error when i tries to give like
    Scenario Outline: Add two numbers
    Given I have entered into the calculator
    And I have enter into the calculator
    When I press add
    Then the result should be on the screen
    @source:Calculator.xlsx
    Examples:
    | num1 | num2 | result |

    Error Custom tool error: Generation error: Missing [assembly:GeneratorPlugin] attribute in C:\Users\RaviKiran Reddy\source\repos\ExcelSpecFull\packages\SpecFlow.Plus.Excel.2-3-0.1.7.0\tools\SpecFlow.Plus.Excel.SpecFlowPlugin.dll

    but when i run like below it is running and gives me output of both excel data and examples data also.
    Scenario Outline: Add two numbers
    Given I have entered into the calculator
    And I have enter into the calculator
    When I press add
    Then the result should be on the screen
    @source:Calculator.xlsx
    Examples:
    | num1 | num2 | result |
    | 5 | 4 | 1 |

    Can you please help me out

    1. Hi Karthik Thanks for the video which is very helpful. I have tried as you mentioned above. But I got error like #error (4:1): Scenario Outline ‘Add two numbers’ has no examples defined.
      My feature file is like below:
      Feature: ReadDataFromExcel

      @mytag
      Scenario Outline: Add two numbers
      Given I have entered into the calculator
      And I have entered into the calculator
      When I press add
      Then the result should be on the screen

      @source:data.xlsx
      Examples:
      | num1 | num2 | result |

      Can you please help me on this.

        1. Hi Karthik Thanks For The Video Which Is Very Helpful. I Have Tried As You Mentioned Above. But I Got Error Like #Error (4:1): Scenario Outline ‘Add Two Numbers’ Has No Examples Defined.
          My Feature File Is Like Below:
          Feature: ReadDataFromExcel

          @Mytag
          Scenario Outline: Add Two Numbers
          Given I Have Entered Into The Calculator
          And I Have Entered Into The Calculator
          When I Press Add
          Then The Result Should Be On The Screen

          @Source:data.Xlsx
          Examples:
          | Num1 | Num2 | Result |

          Even I get this error. Can you please help?

  3. Hi Karthik,

    I am getting error saying ‘No examples defined’ . Please help me!! Thanks in advance.

  4. Not sure if anyone have seen this error but i am getting below error. Any help would be appreciated. Thank you.

    Error (3:1): Scenario Outline ‘Add two numbers’ has no examples defined SpecFlowProject C:\Users\kchennap\Learning\SpecFlow\SpecFlowProject\Features\Calculator.feature 3

    Below is the Code:
    ________________________________
    Feature: Calculator

    Scenario Outline: Add two numbers
    Given the first number is ”
    And the second number is ”
    When the two numbers are added
    Then the result should be 120

    @Source:data.xlsx
    Examples:
    |p0|p1|

Leave a Reply

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