【发布时间】:2019-06-19 16:39:21
【问题描述】:
我不知道如何在 Katalon Studio 中使用变量制作 groovy 代码。 例如。我有一个步骤: 当我转到“示例站点”时
而且我希望这个“当我去”的定义方式是,如果我将任何链接放在功能文件中的引号中,它实际上会将我带到那里。
我告诉你我尝试了什么:
这是常规步骤定义:
@When('I go to (.*)')
def I_go_to() {
WebUI.navigateToUrl('sample site')
}
这是功能文件中 Cucumber 中的步骤:
When I go to "sample site"
但是我得到的只是一个错误提示:
I go to "sample site" FAILED.
Reason:
cucumber.runtime.CucumberException: Step [I go to (.*)] is defined with 0 parameters at 'behat.StepDefinition.I_go_to() in file:/D:/Katalon/katalon-tests/katalon-tests/katalon-tests/bin/groovy/'.
However, the gherkin step has 1 arguments:
* "sample"
Step text: I go to "/admin/structure/taxonomy/manage/category/overview"
at cucumber.runtime.PickleStepDefinitionMatch.arityMismatch(PickleStepDefinitionMatch.java:84)
at cucumber.runtime.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:34)
【问题讨论】:
标签: variables groovy cucumber katalon-studio