【发布时间】:2016-03-04 11:54:30
【问题描述】:
我设置了以下测试用例:
Datasource
Soap Request
Groovy Script
Datasource loop
我想使用 Groovy Script 测试步骤获取 SoapRequest 测试步骤的状态。
如下图所示:
myTestStepResult = testRunner.runTestStepByName("Soap Request")
myStatus = myTestStepResult.getStatus()
但我不想通过脚本运行TestStep,而只是使用soapui testrunner。 在数据接收器测试步骤中,我可以使用它:
${=testRunner.results[testRunner.results.size()-1].status}
不幸的是,上述方法在 GroovyScript TestStep 中不起作用
有什么想法吗?
【问题讨论】:
-
Han van Oostende,您的意思是要使用硬编码的步骤名称吗?请另外澄清?
-
另外,没有得到 - “但我不想通过脚本运行 TestStep,而只是使用 soapui testrunner。”。你能澄清一下吗?
-
希望这澄清:我想运行测试用例不使用 groovyscript testrunner.runTestStepByName
-
搞砸了最后一条评论:希望这可以澄清:我注意到如果我使用 [Groovy Script] myTestStepResult = testRunner.runTestStepByName("Soap Request") myStatus = myTestStepResult.getStatus() 它将运行testStep soapRequest 一次到达 Soap Request 步骤,第二次到达 Groovy 脚本,它调用 testRunner.runTestStepByName("Soap Request") 我只想要第一次调用的状态(当它运行测试用例时)