Forum Discussion
Hi Yakima,
As you don’t know the exact response those value you want to write to a file, I would suggest that you create your own script that will search for the needed value in the entire request and post the results to a file. You can find a sample of how to work with Excel via Groovy here or here.
Thank you very much.
Personally, I would like to keep my scripts as simple as possible and refrain from Groovy Scripts where there is not other way around. It makes it easier to maintain by not so technical resources.
Since this Groovy script was a solution, I would expect the functionality to be built in to easy transfer the message from the assertion to a parameter to be written to the Data Sink.
This script worked for me. I'm storing the result in a global variable and reading it from the Data Sink.
def testStep = testRunner.testCase.getTestStepByName('TestStepName')
// print assertion names an its status
testStep.getAssertionList().each{
com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils.globalProperties['testResult'].value = "$it.label - $it.status"
}