我可以通过在groovy脚本中执行以下操作来记录断言失败的错误消息:
def soapStep = testRunner.testCase.testSteps["SoapRequestStep"]
for( assertion in soapStep.assertionList )
{
if(assertion.errors != null)
{
for( e in assertion.errors )
{
log.info ${e.message}
}
}
}
但是,由于断言失败以外的原因导致测试用例的错误消息失败的方法是什么。例如,
testRunner.fail("Request File is empty")
OR
throw new Exception("foo")