My requirement is to test individually the dynamic list of URL's using specflow for success code 200
Current Approach: URL list is hard coded in the scenario outline like below wherein I am able to test each URL successfully. Here my test runs as many number of URL's present in the scenario outline and I can easily identify the failed tests if any.
Scenario Outline: URL test
Given list of URL's
When I launch each URL
Then I should expect 200 HTTP status code
Examples:
| URL |
| url 1 |
| url 2 |
| url..n|
New Approach: I am thinking to get the list of URL from the web service dynamically instead of hard coding in the scenario outline.
Scenario Outline: URL test
Given a service to get list of URL's
When I call the API get
Then I should expect 200 HTTP status code
With the above approach am able to get the list of URL's and by iterating am able to launch them individually. The problem here is since there is no scenario outline, In a single test, complete list of URL's will be executed.
I need a way wherein I can create a dynamic data set and each URL testing will happen in its own test method, rather executing list of URL's in a single test method.
Tools Used: C# , NUnit , Specflow , Resharper, Visual Studio
Am using ReSharper to execute my tests and I looked about dynamic Table / Instance concepts .