【发布时间】:2018-05-24 09:37:42
【问题描述】:
我目前正在尝试在 SoapUI 中为我的测试套件生成报告。
我的旧工作代码是这样的一行,在 testSuite 拆解脚本中:
def testc = project.testSuites['TestSuite'].testCases['TestCase'].testSteps['xxxxx']
但必须为每个新的测试步骤复制它。
我正在尝试使用的代码是这个:
for (service in project.testSuites) {
for (testCase in service.testCases) {
for (testStep in testCase.testSteps) {
someFile.withWriterAppend{out ->out.println testStep.toString()}
}
}
}
Wich 给了我这个错误:
groovy?lang.MissingPropertyException:没有这样的属性:类的testCases:javaUtil.hashMap$Node
由于我使用相同的路径来访问每个测试步骤,我很惊讶无法通过迭代来完成。
【问题讨论】:
-
Benjamin,请您看看下面的解决方案,看看是否能解决上述问题?如果有帮助,您可以将其标记为answered