Forum Discussion
Unfortunately, this will not work for me: in my teardown script I process statistics file created and it seems like the files are not created yet or they are empty when the loadtest teardown script is executed.
I think it may be due to loadtestrunner context? I mean that the script may run OK from GUI, but fail coz context is different during shell execution via loadtestrunner. The second string in code may not work and list of test cases is not created.
log.info "runnning teardown script" def testCases = testSuite.getTestCaseList(); for (testCase in testCases) { def statisticsPath = "c:\\Programs\\SmartBear\\SoapUI-5.2.1\\loadteststatistics\\" def testCaseName = testCase.name def testCaseReportFile = new File("${statisticsPath}${testCaseName}.csv") def testCaseResultFile = new File("${statisticsPath}${testCaseName}.log") if (testCaseResultFile.exists()) { testCaseResultFile.withReader {reader -> testCaseReportFile.append(reader.readLine() + '\n')} //testCaseResultFile.withInputStream {input -> testCaseReportFile << input} } }
Hi,
Ok, since the load test setup script runs at TestCase level rather than TestSuite (which can have multiple TestCases), how about if you modify the script to work for just the TestCase that the load test is for e.g. something like:
og.info "runnning teardown script" def statisticsPath = "c:\\Programs\\SmartBear\\SoapUI-5.2.1\\loadteststatistics\\" def testCaseName = loadTestRunner.loadTest.testCase.name def testCaseReportFile = new File("${statisticsPath}${testCaseName}.csv") def testCaseResultFile = new File("${statisticsPath}${testCaseName}.log") if (testCaseResultFile.exists()) { testCaseResultFile.withReader {reader -> testCaseReportFile.append(reader.readLine() + '\n')} //testCaseResultFile.withInputStream {input -> testCaseReportFile << input} }
Sorry, if I've missed something and I haven't tested this code, just thought you could get the TestCase name instead using loadTestRunner.loadTest.testCase.name
Regards,
Rup
Related Content
- 7 years ago
- 6 years ago
Recent Discussions
- 15 years ago