繁体   English   中英

如何使用groovy获取soapui测试步骤的状态?

[英]How to get status of soapui test step using groovy?

我需要将 SOAPUI 测试用例的测试步骤名称、预期结果、实际结果写入外部文件,但我不知道如何获取测试用例中每个测试步骤的状态。 例如,我的 SOAPUI 测试用例将包含 Groovy 脚本、REST 请求测试步骤,我需要在执行这些测试步骤时获取每个测试步骤的状态并将其写入外部文本文件。 你能帮我看看我该怎么做吗?

示例 groovy 脚本测试步骤

def tfscoesoapuiutility = context.testCase.testSuite.project.myObject(context)

def db = tfscoesoapuiutility.connectToDB()
def testSuiteName = tfscoesoapuiutility.getTestSuiteName()
def schemaName = tfscoesoapuiutility.getSchemaName()
def dataScenario = tfscoesoapuiutility.getTestCaseName()
tfscoesoapuiutility.retrieveDataScenario(dataScenario)

假设您将TestStep 的对象放入变量step并使用以下语句来处理相同的状态:

log.info new com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStepResult(step).status.toString()

我已经尝试了上述解决方案,但遇到了以下错误:groovy.lang.GroovyRuntimeException:找不到以下匹配的构造函数:com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep(com.eviware.soapui.impl.wsdl .teststeps.RestTestRequestStep)错误,位于第20行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM