'is there a way to pass a param in cucumber feature file on runtime?

feature.java

@Scenario : Check if two files have same content

@Given Two files : file1 and file2

@And match file content : /path/to/file1, /path/to/version/file2

stepDef.java

@And("^match file content : (.), (.)$")

public static void isEqual(File file1, File file2){

// code to check if the contents of file1 & file2 are equal

}

Since file2 is present under a specific version and the path will change based on version, is there a way to pass a param in feature file on runtime?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source