def fileList = []
new File("C:\\requests").eachFile { f ->
if (f.isFile() && f.name.endsWith('.xml')) {
def filename = f.name[0..-5]
fileList.add(filename)
}
}
if (fileList.size() < 1) {
testRunner.fail("No request files")
}
context.put('fileList', fileList)
${=new File("C:\\requests\\" + (context.get('fileList')).last() +".xml").text}
def fileList = context.get('fileList')
def fileName = fileList.pop()
def response = context.expand( '${Test Request#Response}' )
def f = new File("C:\\responses\\${fileName}_Response.xml")
f.write(response, "UTF-8")
if (fileList.size() > 0) {
testRunner.gotoStepByName('Test Request')
}
@Ashik wrote:
Hi,
how to add the request step script you mentioned.....just pasting the given script doesnt work...
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/essaytyper" xmlns:cal="http://www.parasoft.com/wsdl/calculator/">
<soapenv:Header/>
<soapenv:Body>
<cal:add>
<cal:x>?</cal:x>
<cal:y>?</cal:y>
</cal:add>
</soapenv:Body>
</soapenv:Envelope>
This is my actual xml request which i need to fetch....
Hi! I wanted to ask if you figured out how to make the script work?
Subject | Author | Latest Post |
---|---|---|