Hello,

I am able to do jbehave statements like

    When I type "foo" into foobar

       or

    When I type "89" into age

The java for this could be:

//non-parametrised 
@When("I type \"<text>\" into <field>")
        @Aliases(values = { "I type \"$text\" into $field" })
        public void type(@Named("text")
                    String text, @Named("field")
                    String field) {
                selenium.type(field, text);
}

The next thing I am trying to figure out is how to use 
parametrised scenarios,
so I can repeat the same story steps for each item.

Examples:

|food|
|pizza|
|bacon|
|celery|

Obviously, I don't want to do this:

When I type "pizza" into food
....
....

When I type "bacon" into food
....
....

I looked at the TraderSteps.java program and was trying to do 
something like this:

//parametrised 
@When("I type \"<food>\" into <field>")
        @Aliases(values = { "I type \"$food\" into $field" })
        public void type2(@Named("food") 
        String food, @Named("field") String field) {
                selenium.type(field, text);
}

Question:

In the above method, How do you assign the "<" and ">" around food, 
so you have <food>?

Thanks for any advice on how to use parametrised scenarios.






---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to