I’m working with SpecFlow
and have the following scenario
outline:
Scenario Outline: Check Response
Given I logon with User '<User>'
Then the return code is '<StatusCode>'
And the response contains accounts with the following data:
| UserName | Address | Id | Type |
| Test1 | 1.1.1.1 | 34533 | Windows |
| Test2 | 2.2.2.2 | 74343 | Windows |
| Test3 | 3.3.3.3 | 743223 | Windows |
| Test4 | 4.4.4.4 | 345674 | Windows |
Examples:
| User | StatusCode |
| User1 | 200 |
I want to add another test case with a different set of table data. However, I need to write another scenario if I want to verify a different table value, which duplicates a lot of code.
Is there a way to include the table data (like UserName, Address, Id, Type
) directly in the Examples
section so that each row in the Examples table can verify different table
values without writing a new scenario?
Any suggestions or best practices on how to structure this in SpecFlow
?