Forum Discussion
Probably that can be used or used that quick code to adopt for the above requests.
- SuperSingh8 years agoContributor
Here's the sample that copies my request and response and stores it externally.
def ReqFile ="C:/Testing Lab/Soap TestBed/Response Data/ReqFile1.xml"
def Req = context.expand( '${Rate#Request}' )
def i = new File(ReqFile )
i.write(Req, "UTF-8")def ResFile ="C:/Testing Lab/Soap TestBed/Response Data/Response1.xml"
def Res = context.expand( '${Rate#Response}' )
def j = new File(ResFile)
j.write(Res, "UTF-8")Thanks,
Predator
- Amyread7 years agoOccasional Contributor
I am using this code to retrieve response in a test suite. Can you please help
I have a test suite with few rest api test cases.
I need to automatically save all responses in a folder when the test suite is run with the test case name.xml
def ReqFile ="C:/soapui/environment/DEV Environmentl"
def Req = context.expand( '${Rate#Request}' )
def i = new File(ReqFile )
i.write(Req, "UTF-8")- SuperSingh7 years agoContributor
Try the following :
def ResFile ="C:/Testing Lab/Soap TestBed/Response Data/Response1.xml"
def Res = context.expand( '${TestCaseName#ResponseAsXml}' )
def j = new File(ResFile)
j.write(Res, "UTF-8")
- SuperSingh8 years agoContributor
I've shared the script you've asked for. I tried fitting my JDBC in that script, but doesn't work.
Appreciate any help here.
Thanks,
Predator.
- nmrao8 years agoChampion Level 3SuperSingh,
Have you tried the same context.expand( '${JDBCTestStep#Request}' ) - change the test step name in place of JDBCTestStep and the same for response as well.
If you have already tried that and still did not work? then quite strange.- SuperSingh8 years agoContributor
nmrao I did try that step. But it doesn't work.
It creates a file with no data in it. I tried changing the file formats to .txt but no luck . :(