如何通过groovy脚本从SoapUI负载测试中导出统计数据?

问题描述 投票:0回答:1

我有一个带有负载测试的工作项目。

def loadTest = testRunner.testCase.testSuite.project.getTestSuiteByName("Load").getTestCaseByName(testCaseSelect).getLoadTestByName(loadTestSelect)

loadTest.run().waitUntilFinished()

我需要从这个地方导出统计数据:

我试过了

def testResults = loadTest.getStatistics()
testResults.exportToCsv("C:/Users/tester/Desktop/statistics.csv")

但我收到错误:

groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.loadtest.WsdlLoadTest.getStatistics() is applicable for argument types: () values: [] Possible solutions: getStatisticsModel() error at line: 92

我询问了 ChatGPT,但任何解决方案都不起作用(也许我的提示不正确:))

groovy soapui load-testing groovyscriptengine
1个回答
0
投票

或者,也许 ChatGPT 就是垃圾 🤔

通过查看Javadoc这里这里,你尝试过吗

def testResults = loadTest.getStatisticsModel()
new ExportStatisticsAction(testResults).exportToFile(new File("C:/Users/tester/Desktop/statistics.csv"))

没有测试过,但它来自实际的帮助文档,而不是通过单词统计模型想象的

© www.soinside.com 2019 - 2024. All rights reserved.