在特征文件表shell中使用特殊字符(撇号)

时间:2017-10-12 15:40:12

标签: java selenium cucumber

我在Selenium中编写了一个特征文件,其中一个表shell中有一个撇号。在运行测试用例时,Cucumber报告出现了,因为无法翻译"'""作为有效的角色。像这样:

Then user sees the following title
|Banker's report for this month|

我该如何解决这个问题?我试过了

|Banker\'s report for this month|

但它不会起作用

1 个答案:

答案 0 :(得分:0)

您可以将步骤定义更改为

Then user sees the monthly bankers report

并让步骤定义(代码)指定字符串。