Soapui 正确的测试用例执行给出一个';失败';地位

Soapui 正确的测试用例执行给出一个';失败';地位,soapui,ready-api,Soapui,Ready Api,我在测试用例执行方面有一个奇怪的问题 我有一个具有以下结构的测试用例: Setup script: set session_id = 0 set session_index = 0 store custom properties in an external file 以及测试用例体 Test Case: data source SOAP - authentication on components (gives session_id for each com

我在测试用例执行方面有一个奇怪的问题

我有一个具有以下结构的测试用例:

Setup script:

  set session_id = 0

  set session_index = 0

  store custom properties in an external file
以及测试用例体

Test Case:

  data source

    SOAP - authentication on components (gives session_id for each component)

    groovy - recover useful data (store session_id in custom prop session_id_<session_index>)

  source loop

  SOAP - start asynchronous service on component 1

  SOAP - check status on component 1

  goto 'check status' while status = Pending

  SOAP - check status on component 2

  goto 'disconnect terminals' is session_id = 0

  SOAP disconnect

  groovy disconnect terminal : loop for each session_index: set session_id = session_id_<session_index> and use it in the SOAP disconnect step (I use run test step)
测试用例:
数据源
组件上的SOAP身份验证(为每个组件提供会话id)
groovy-恢复有用数据(将会话\u id存储在自定义的prop会话\u id中)
源循环
SOAP-在组件1上启动异步服务
SOAP-检查组件1上的状态
状态=挂起时转到“检查状态”
SOAP-检查组件2上的状态
转到“断开端子”是会话\u id=0
SOAP断开
groovy disconnect terminal:loop for each session_index:设置session_id=session_id_,并在SOAP断开连接步骤中使用它(我使用运行测试步骤)
拆卸脚本:还原自定义属性

所有这些步骤都成功执行,我没有任何错误记录,但整个测试的状态为失败

我意识到问题来自goto步骤: 当返回的状态设置为“挂起”时,我将返回到SOAP请求以检查状态。因此,每次请求返回“挂起”时,它都会失败,我会再次发送检查请求。 当状态最终为“success”时,testStep变为绿色(OK),testCase继续


在总体结果中,多次播放的测试步骤在每次“迭代”中存储一次,其结果仅在最后一次出现时是正常的,因此总体测试状态为失败。

此问题有一个解决方法:

我检查了测试结果,并在testRunner.results中检查了一些被认为失败的测试步骤。为此,我在“拆卸脚本”选项卡中设置了以下代码

for (testStep in testRunner.getResults()){
    log.info "status " + testStep.getTestStep().getName() + " : " + testStep.getStatus()
}
这些步骤是我正在循环的步骤,等待与“待定”不同的状态。 在测试结束时,当状态最终为“成功”时,该步骤在testCase中设置为OK(绿色标记),即使多次出现testStep“失败”(这令人困惑)

因此,我发现我可以通过以下步骤更新这些状态:

for (results in testRunner.results){
 // implement a selection condition
    results.status = "OK"
}
我只需要确保我只在相关的测试步骤上应用它

但最终,总体状态仍然是失败的,仍然在我的拆卸脚本中:

log.info "TEST RUNNER STATUS after update" + testRunner.getStatus()
如果我确定我的步骤和结果,我可以按如下方式覆盖它:

testRunner.status = "FINISHED"
log.info "TEST RUNNER STATUS after update" + testRunner.getStatus
我的整体测试正常(绿色条)

我知道这有点棘手,但只要我设置适当的条件来更新这些参数,我肯定不会隐藏真正的失败

如果有人有更干净的方法,我会很感激的