Forum Discussion
SmartBear_Suppo
Alumni
15 years agoHi Pierre,
hmm.. one way to do this would be to create a project event handler for the TestRunListener.afterStep event in which you would check if the executed teststep was a request teststep (via its config.type property) and then check its requests response object for attachments.. ie something like this:
// was this a SOAP request?
if( testStepResult.testStep instanceof WsdlTestRequestStep )
{
// loop the attachments
for( a in testStepResult.testStep.testRequest.response.attachments )
{
// create filename
def fileName = ...
// write to file
com.eviware.soapui.support.Tools.writeAll( new FileOutputStream( fileName ), a.inputStream )
}
}
Hope this helps!
regards,
/Ole
eviware.com
hmm.. one way to do this would be to create a project event handler for the TestRunListener.afterStep event in which you would check if the executed teststep was a request teststep (via its config.type property) and then check its requests response object for attachments.. ie something like this:
// was this a SOAP request?
if( testStepResult.testStep instanceof WsdlTestRequestStep )
{
// loop the attachments
for( a in testStepResult.testStep.testRequest.response.attachments )
{
// create filename
def fileName = ...
// write to file
com.eviware.soapui.support.Tools.writeAll( new FileOutputStream( fileName ), a.inputStream )
}
}
Hope this helps!
regards,
/Ole
eviware.com