Specflow - using data from external file in feature file

We have a new plugin to get external data from json files.

It is a simple SpecFlow plugin that you can install as a NuGet package.

Example of usage:

@property:email=E-mail_addresses.Valid
Scenario Outline: recording user information on successful registration

Given a visitor registering as "Mike Scott" with email <email>
When the registration completes
Then the account system should record <email> related to user "Mike Scott"

Examples: key examples
  | Variant            | email              |
  | simple valid email | simple@example.com |

The json file looks like this:

{ 
  "E-mail addresses": {
    "Valid" :{
      "Simple": "email@domain.com",
      "Dot in the address": "firstname.lastname@domain.com"
    }
  }
}

More details are in the blog post about it: https://specflow.org/blog/new-plugin-externaldata-helps-you-improve-test-coverage-quickly/


Full disclosure: I am the community manager of SpecFlow and SpecFlow+


Comments

  1. Major

    • 2016/10/27

    We have a new plugin to get external data from json files. It is a simple SpecFlow plugin that you can install as a NuGet package.

  2. Xander

    • 2020/8/12

    Get all of the external data you need including consumer patterns and web-crawled sets. Use one platform to access thousands of external data sources for faster insights.

  3. Alvarez

    • 2020/3/30

    Hello everyone, I am using SpecFlow for my test, and in feature file I've got table with examples, but those examples are changing over

  4. Kohen

    • 2021/5/8

    I am using SpecFlow for my test and looking for a way to using inupt data from excel/csv/json in my feature file. I am treed to use SpecFlow+ Excel but it's not compatible with .NETCore and SpecFlow 3.3.57 which I am using. I also tried to use Itamaram.Excel.SpecFlowPlugin but it also didn't work.

  5. Matias

    • 2021/5/16

    Simply download the NuGet package and add it to your specflow projects to use it. Supported Data Sources¶. CSV files (format 'CSV', extension .csv). > Note: 

  6. Jairo

    • 2018/6/4

    I am using SpecFlow for my test, and in feature file I've got table with examples, but those examples are changing over time and their amount also changes. So I would like to get them from external files (xlsx, csv, json, xml or whatever).

  7. Cattaneo

    • 2017/4/4

    Data Driven automation Using External file in Specflow In order to read data from excel in Specflow, we have to use C#. below is the example of C# program to 

  8. Williams

    • 2018/5/13

    Use the @DisableDataSource If you want a select few scenarios in the feature file to not use the data source tagged at feature node level. @DataFormat:format - This tag only needs to be used if the format cannot be identified from the file extension. @DataSet:data-set-name - This tag is applicable to Excel files only. It is used to select the

  9. Vitale

    • 2018/5/6

    Data Driven Testing in SpecFlow using External Files Note: The last two circled files (SpecFlowFeature1.feature 

  10. Vivaan

    • 2019/1/16

    Feature files on this level could use a specific message format, similar to what David proposed, or just abstract it away as in Fin’s example. Fin explains his approach: In the step definition, I hide the logic in a paymentMessageService , on how to create a payment message with default data + the provided data.

  11. Samuel

    • 2021/6/24

    To do so, it uses a file type with feature extension. Imagine a project, where you have to import some CSV files from an external source 

  12. Ayaan

    • 2018/12/5

    Data-driven automation is a process to execute the same test case with multiple inputs. Specflow provides the following ways to perform data-driven testing in Specflow. Using Parameterization. Using Example or ScenarioOutlines. Using table. Using External files like Excel. Parameterization in Specflow. Parameter is used to pass data to step

  13. Mark

    • 2015/8/15

    CucumberStudio enables you to upload feature files written using Gherkin syntax (Cucumber, SpecFlow, …) Enable the BDD mode. The import is 

  14. Roman

    • 2017/6/3

    And the good part is that the SpecFlow inherently supports Data Driven Testing using Scenario Outline. There are different ways to use the data insertion within the SpecFlow and outside the SpecFlow with external files. Data Driven Testing in SpecFlow. Parameterization without Example Keyword; Data Driven Testing in SpecFlow using Scenario Outline

  15. Mehmeti

    • 2020/6/28

    I would not choose to try to import data from a CSV file into Gherkin. If I had to read data from the CSV file, I would do it using a helper

  16. Ortiz

    • 2020/12/24

    The external binding assembly can also use a different .NET language, e.g. you can write bindings for your C# SpecFlow project also in F# (As an extreme case, you can use your SpecFlow project with the feature files only and with all the bindings defined in external binding assemblies).

  17. Lennon

    • 2018/7/16

    feature file conventionally consists of a single feature. Lines starting with the keyword Feature: (or its localized equivalent) followed by three indented 

  18. Ulises

    • 2015/11/9

    Get all of the external data you need including consumer patterns and web-crawled sets. Use one platform to access thousands of external data sources for faster insights.

Comments are closed.

Recent Posts