Hi,
You can use @Named("userName") with your method parameter. Your code becomes
@Given("user name is $userName")
public void setUserName(@Named("userName") String userName) {
........................
}
Cheers
Cordialement/Regards,
Louis GUEYE
linkedin <http://fr.linkedin.com/in/louisgueye> |
blog<http://deepintojee.wordpress.com/>|
twitter <http://twitter.com/#%21/lgueye>
2013/6/7 Thiwanka Somasiri <[email protected]>
> Hi,
>
> I am new to Jbehave and need a clarification regarding writing stories.
>
> I have a step in the story where it gives a name of a person as "James
> Bond", without
> quotation marks. So I have to write a step in my step class as follows,
>
> Scenario:
> Given user name is James Bond
>
> @Given("user name is $userName")
> public void setUserName(String userName) {
> ........................
> }
>
> In this case how can I capture the value James Bond to my userName
> parameter?
>
> Thanks.
>
>
>
>