如何在SOAP UI中将执行流程完全转移到另一个步骤

时间:2016-11-22 18:22:14

标签: groovy soapui ready-api

我正在尝试使用groovy将执行流程转移到SOAPUI中的另一个步骤。 我正在使用gotoStepByName,但执行后返回到下一行代码。

我总是假设runTestStepByName将调用测试步骤..完成执行并继续剩余的代码。

当gotoTestStepByName实际执行时,执行该步骤并继续执行后续步骤,而不返回并执行剩余的代码。

if (json.size() == 0) {     
    testRunner.gotoStepByName( "DataSink")
    log.info "coming back here again"   
}

在这里,我看到流量实际上又回来了,打印'再次回到这里......'

我怎样才能将执行流程从groovy转移到另一个步骤而不执行其余的代码和传输步骤之前的其余步骤。?

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

要将执行转移到其他步骤(并跳过任何中间步骤),您可以使用gotoStepByName

要停止执行当前的Groovy脚本,您可以使用return语句

所以问题中提供的代码如下所示:

if (json.size() == 0) {     
    testRunner.gotoStepByName( "DataSink") // Transfer execution to other step
    return                                 // Stop execution of current script
    log.info "coming back here again"   
}
相关问题