How to pass a parameter "abc" : "12" to a cucumber(Java) step How to pass a parameter "abc" : "12" to a cucumber(Java) step selenium selenium

How to pass a parameter "abc" : "12" to a cucumber(Java) step


The regular expression doesn't match the text since you've got a space not accounted for just before the first quote.

Add the missing space and use .+ to match the group:

@Then("I pass a string \"(.+)\"")public void function(String data){    System.out.println(data)}