Forum Discussion
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
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
- 2 days ago
- 7 days ago
xml to soap
Solved7 days ago