0

feature file: enter image description here

StepDefinitionClass:

enter image description here

result:

enter image description here

How can I get the expected value(url)?

yan
  • 11
  • 3

1 Answers1

0

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.

user861594
  • 5,733
  • 3
  • 29
  • 45