Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
6.3k views
in Test Automation by
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 like 0 dislike
by The go-to Tester (181 points)
selected by
 
Best answer
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("+");
}


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...