Forum Discussion
10 Replies
- nmrao
Champion Level 2
Can you show your existing script which saves the request and response xmls?
Probably that can be used or used that quick code to adopt for the above requests.- SuperSinghContributor
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
- AmyreadOccasional 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")
- SuperSinghContributor
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.
- nmrao
Champion Level 2
SuperSingh,
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.