StepDefinitionClass:
result:
How can I get the expected value(url)?
You can try setting step.provider.sharedinstance
property to true
. Refer list of properties used by the framework.
Another alternate is using configuration manager to pass data between steps.
@QAFTestStep(description = "create new user")
public void createUser(){
//do needful
//store outcome to be used later
getBundle().setProperty("newcreated.user", user);
}
@QAFTestStep(description = "print user")
public void printUser(){
User user = (User)getBundle().getProperty("newcreated.user");
//do the needful
}
This way is preferred over sharing data using class variables, because sharing through class variables will restrict steps to be in the same class.