header
header
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome, Guest. Please login or register.
December 04, 2008, 11:44:08 pm
Username: Password:
Login with username, password and session length

Forgot your password?
 
Saving attachments automatically
Welcome, Guest. Please login or register.
December 04, 2008, 11:44:08 pm
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  soapUI
| |-+  soapUI
| | |-+  Saving attachments automatically
« previous next »
Pages: [1] Print
Author Topic: Saving attachments automatically  (Read 441 times)
Wilco Schreurs
Newbie
*
Posts: 1


« on: November 02, 2007, 09:32:02 am »

I am testing a webservice that returns an attachment (MIME).
Is there a way to automatically save the retrieved attachment, preferably to a filename and folder that I can specify.
I know I can manually save attachments, but I would like to do that automatically, as part of a testsuite>testcase>teststep.
Maybe by using a particular assertion script?
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,506


« Reply #1 on: November 02, 2007, 10:05:37 am »

Hi!

sure.. create a groovy script step after your request and use something like the following:

def testStep = testRunner.testCase.getTestStepByName( "request.." )
def response = testStep.testRequest.response

def outFile = new java.io.FileOutputStream( "myfile..")
def in = response.attachments[0].inputStream

com.eviware.soapui.support.Tools.writeAll( outFile,  in )


Hope I got that right.. :-)

regards!

/Ole
eviware.com

Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
header header
header
header