REading test data from JSON file in Specflow | Selenium C# Forum
S
Shilpa Posted on 27/09/2020

Hi,

I want to create different JSON test data files for different environments and then read the data in different steps of the step definition file. What is the best approach to do this? Do you have an example for the same?

 

Example:

My json file is 

[
{
"id": 1,
"title": "json-server",
"author": "User1"
},
{
"id": 2,
"title": "https-server",
"author": "User2"
}
]

 

Now, I want to read id in "Given" Method (Rest Request) and verify the other details in "Then" Method (Response).