Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capturing response to a soapUI test run

I am using soapUI's testrunner.bat to to perform a test from the command line. I would like to examine the response to the web service call. This is easily accomplished from the UI, but I haven't seen an option that will dump the response to file. Here is the command I am using:

testrunner.bat -sSuite -cPingProduction -r -I "C:\Program Files\eviware\Projects\Project-webchecker-soapui-project.xml"

This command does generate a log file, but it has no response/requests in it.

Thanks.

like image 263
laconicdev Avatar asked Dec 15 '11 18:12

laconicdev


People also ask

How do I record a response in SoapUI?

Saving Responses in SoapUI To write responses to a file from in SoapUI, use the following "Request Properties": Select the request you want to store responses from. In the "Request Properties" panel window scroll down to the property "Dump File", and enter a path for "Dump File".

How do I export a response in SoapUI?

SoapUI is intended for testing; if you want to save your test results, you'll have to do that explicitly. To save a specific response message, use the context menu of the response editor, (or press Ctrl+S), and save it to file. You can load it back if you want, using the same context menu (or press Ctrl+L).


1 Answers

I did this by creating a Test Step (within a Test Case) and using this Groovy Script:

def response = context.expand( '${request#Response}' ) 
// where request is the name of your request
new File( "C:/response.txt" ).write( response )

Your syntax for calling testrunner.bat is correct and I have verified that it works for me.

like image 168
DaveG Avatar answered Oct 13 '22 05:10

DaveG