yognsal
8 years agoOccasional Contributor
How i can save only limited (say first 100 lines) SOAP UI response in excel sheet using groovy scrip
I want to save only first 100 lines from response which is in JSON format. Because when my response is too big then excel can not hold the entire response in one cell. so it gets crashed, and i ...
- 8 years ago
One option is truncate the response to the maximum number of characters that can saved in Excel, or less.
context.response.take(32000)
https://stackoverflow.com/questions/3226487/how-to-truncate-a-string-in-groovy
- 8 years ago
Like pretty print?
import groovy.json.* log.info JsonOutput.prettyPrint(context.response)
- 7 years ago
The script I gave you updates all Test Cases in the same Test Suite (as the script).
You can go one step further out if you want to update all Test Cases in all Test Suites in the current Project:
testRunner.testCase.project.testSuites.each { testSuite -> testSuite.value.testCases.each { testCase -> testCase.value.testSteps.each { def testStep = it.value if (testStep instanceof com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep) { testStep.testRequest.setDiscardResponse(true) } } } }