[英]How to pass "#" as a valid parameter in feature file using java cucumber
I have to pass "#" symbol as parameter in feature file.我必须在功能文件中传递“#”符号作为参数。 How to achieve that as # symbol represents comments in feature file
如何实现#符号代表功能文件中的注释
If you are using cucumber version 4.xx or above you can use (.*) regular expression in step definition to take any kind of parameters.如果您使用的是 4.xx 或更高版本的 Cucumber,您可以在步骤定义中使用(.*)正则表达式来获取任何类型的参数。
Sample Feature File:示例特征文件:
Scenario: User searches for a character in Search
When The user searches for # in the Search
Sample Step Definition:示例步骤定义:
@When("The user searches for (.*) in the Search")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.