You'd want to use parametrised scenarios when there is a need to repeat the 
execution of the scenario for different combinations of parameters.

Using it with only row of data is redundant and impacts readability.

If you want to avoid specifying the username or other reusable parameter you 
should provide it once in a Given step and use it in the other steps.


> On 5 Feb 2014, at 12:30, Hans Schwäbli <[email protected]> wrote:
> 
> I am asking myself whether it is a good idea to use example tables all the 
> time or only on demand.
>  
> Lets take this scenario to illustrate the options:
>  
> Scenario: Login
> When I login with username Hans and password Swordfish
> Then I am logged in and username Hans is displayed
>  
> It could be possible to use an example table for it:
>  
> Scenario: Login
> When I login with username <username> and password <password>
> Then I am logged in and username <username> is displayed
> Examples:
> |------------------|
> |username|password |
> |------------------|
> |Hans    |Swordfish|
> |------------------|
>  
> The username is a bit redundant in the first example since it occurs two 
> times and might have to be changed in two places.
>  
> In the second example the redundancy is removed by using an examples table.
>  
> The first scenario example is more readable I think, escpecially for 
> non-programmers, since they don't have encounter variables there, wheras the 
> second example is more maintainable.
>  
> What would you do in such and similiar cases? Accept the redundancy or remove 
> it wherever possible with an examples table?

Reply via email to