...
Note : Pass variable index number instead of the variable name.
Code Block |
---|
import com.qmetry.qaf.automation.step.QAFTestStep; import static com.qmetry.qaf.automation.core.ConfigurationManager.getBundle; public class StepsLibrary { // for single type of variable @QAFTestStep(description = "my custom steps to store value in variable {myVariable0}") public static void myJSmethodToStoreVariable (String myVariable) { // my code for java script String myValue = "value which i want to store"; getBundle().addProperty(myVariable, myValue); } // for multi variable type @QAFTestStep(description = "my custom steps to Add value {0} and {1} to {2} value") public static void myCustomSteptoAddVariable(String myvar1,String myvar2,String myvar3) { // my code logic System.out.println(myvar1+myvar2+myvar3); } } |
Example :
Or
If you directly want to do it by coding, refer below code :
...