Forum Discussion
Probably that can be used or used that quick code to adopt for the above requests.
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")- Amyread7 years agoOccasional Contributor
Thank you.
But I have sever test cases in a test suite. I will need all of the responses save to a folder. how can I change the script. Can I give the test suite name instead of tescasename ? Please help
Related Content
Recent Discussions
- 15 years ago