Showing posts with label SOAP UI Groovy Scripts. Show all posts
Showing posts with label SOAP UI Groovy Scripts. Show all posts

Thursday, July 25, 2013

SOAP UI Groovy Script : Reading a Text File using Groovy

new File("C:\\test.txt").eachLine{
 
line->log.info line
 
}

Tuesday, July 23, 2013

SOAP UI : Groovy script to Store request files in local directory

SOAP UI : Groovy script to Store request files in local directory

//Path and File name to store request
def requestFile = "C://request.xml"
//Reading request content into an object
def request = context.expand( '${MyRequestName#Request}' )
//Accesing file created
def file = new File(requestFile)
//Writing request into the file created
file.write(request, "UTF-8")

Monday, July 22, 2013

SOAP UI : Groovy Script to store response files in local directory


//Path and File name to store response
def responseFile = "C://response.xml"

//Reading response content into an object
def response = context.expand( '${MyRequestName#Response}' )
//Accesing file created
def file = new File(responseFile)
//Writing response into the file created
file.write(response, "UTF-8")