如何使用 groovy in soap ui for Project 创建摘要报告
How to create the Summary Report using groovy in soap ui for Project
我正在使用 groovy
为我的 soap ui 项目准备 HTML 总结报告
使用下面的拆解脚本,我可以读取测试用例状态和名称,但不确定项目报告,因为拆解可以在测试 suite 下编写。
enter code here
{代码}
def failedTestCases = 0
runner.results.each { testCaseResult ->
def name = testCaseResult.testCase.name
if(testCaseResult.status.toString() == 'FAILED'){
failedTestCases ++
log.info "$name has failed"
testCaseResult.results.each{ testStepResults ->
testStepResults.messages.each() { msg -> log.info msg }
}
}else{
log.info "$name works correctly"
}
}
log.info "total failed: $failedTestCases"
{代码}
即使在测试项目级别也可以使用拆卸选项
我添加了一条消息和运行项目并且成功了
如果您使用的是 SOAPui 而不是 Ready API
拆解脚本见下方
我正在使用 groovy
为我的 soap ui 项目准备 HTML 总结报告使用下面的拆解脚本,我可以读取测试用例状态和名称,但不确定项目报告,因为拆解可以在测试 suite 下编写。
enter code here
{代码}
def failedTestCases = 0
runner.results.each { testCaseResult ->
def name = testCaseResult.testCase.name
if(testCaseResult.status.toString() == 'FAILED'){
failedTestCases ++
log.info "$name has failed"
testCaseResult.results.each{ testStepResults ->
testStepResults.messages.each() { msg -> log.info msg }
}
}else{
log.info "$name works correctly"
}
}
log.info "total failed: $failedTestCases"
{代码}
即使在测试项目级别也可以使用拆卸选项
我添加了一条消息和运行项目并且成功了
如果您使用的是 SOAPui 而不是 Ready API
拆解脚本见下方