Question

I'm newbie to jbehave, and I plan to use it with thucydides+selenium. Among the tests I'd like to design, there is a step, that will have no input parameter, but will return some value, to be used in further parameterized steps. However, i don't see the way to obtain the parameter from one of steps and use it as input parameter in others.

I know, that in the class where the steps are defined I can define a variable that will be accessible for all Step methods and use it in all steps I want. But it will not be seen by the 'business people' when they will work with textual scenarios.

So, what is the way to do it?

Upd.

Say, in the first test or step I'm getting some random value, say, some token. Since the token is random, I can't assert it with someting, but I'd like to make this key obtaining as separate step or test due to business requirements.

In the next test or step I'd like to use the value of this random token obtained from he first step or test. I'd like my business users to see that this value, that is an input data to the second step or test was an output from the second step or test, and here it is.

Was it helpful?

Solution

Are you try for the below scenario ?

Given .....
When.....
Then.....
When the account comes to active state generate  myAccnumber
Then print myAccnumber

That is,The Business people need to access(or pass) the myAccnumber in forthcoming steps.Right?

In such case, declare a static variable in your step definition(As you suggest)class and let all your step definition can share it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top