I've got scenario:

Given As customer I add product $productCode to my basket
And I add product $productCode2 to my basket
And I add product $productCode3 to my basket
Then ... 

Tabular data:

P2222222     

And method definitions like that:

    @Given("As $actor I add product $productCode to my basket")
    public void as_actor_i_add_product_to_basket(final String actor, final 
String productCode) {
        theActorNamed(actor).can(BrowseTheWeb.with(webDriver));
        theCurrentActor().wasAbleTo(StartWith.productPage(productCode));
        theCurrentActor().attemptsTo(AddProductToCart.add());
    }

    @Given("I add product $productCode to my basket")
    public void i_add_product_to_my_basket(final String productCode)
    {
        theCurrentActor().wasAbleTo(StartWith.productPage(productCode));
        theCurrentActor().attemptsTo(AddProductToCart.add());
    }

And every time I executed it, it added the first product: P1111111 three 
times.
I expect too have 3 different products added.

Later, in *Then *section, I want to access those product codes once again. 
Can you help me?

I was trying to use named parameters, I've read that: 
http://jbehave.org/reference/stable/parametrised-scenarios.html and that 
http://jbehave.org/reference/stable/parameter-injection.html
I don't have any idea how to make it work.

-- 
You received this message because you are subscribed to the Google Groups 
"JBehave Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/jbehave-dev/d732b55c-40df-4cb5-8ccb-b16e204178ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to