SoapUI -来自groovy的控制流



在我的groovy脚本中,我有一个循环,我想执行测试步骤"MyTestStep"运行两次:

for (i = 0; i < 3; i++) {
testRunner.runTestStepByName("MyTestStep2")
}

在运行groovy脚本时正常工作-但是当我启动测试用例时,测试运行器首先运行我的groovy脚本,然后再次运行&;myteststep &;

这不是我想要的

关于如何只能从groovy-script运行测试步骤的建议?

--MyTestCase
---TestStep1 GroovyScript that executes teststep2 two times
---TestStep2: MyTestStep containing a rest request

所以当我按play of MyTestCase:第一个groovy脚本开始,这是ok的。但是测试会继续执行TestStep2。

既然我想明白了,我就回答我自己的问题:而不是:

testRunner.runTestStepByName("MyTestStep2")

我使用:

testRunner.gotoStepByName("MyTestStep2")

最新更新