0
how to pass integer value to cucumber-jvm given, when or than statements

Solved 1 Answers 584 Views Test Automation
0 1
I've a statement with integer value. I need to pass it to my test as an integer. How can I do that?

 

e.g.

 

When my account number is 6298

Than my account will be 6298

Given my account number is 6298

1 Answer

0
Best answer
0
You can use (\\d+) for the same.

 

@When("^I add (\\d+) and (\\d+)$")
    public void adding(int arg1, int arg2) {
        calc.push(arg1);
        calc.push(arg2);
        calc.push("+");
}
answered by (151 points)
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...