I would only use an examples table if there was more than one row of data. 
Using the first example you gave, I would remove the redundancy in the Steps 
file by setting a username variable the first time its used, and then just 
reference that variable with the final step:

Then I am logged in and the username is displayed




On 5 Feb 2014, at 13: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