Forum Discussion
- omatzuraSuper ContributorHi!
sure.. try the following after you have received a response:def testRequest = testRunner.testCase.testSteps["Request 1"].testRequest
def out = new FileWriter( "out.txt" )
out.println( testRequest.requestContent )
out.println( testRequest.response.contentAsString )
Hope this helps!
regards,
/Ole
eviware.com - srinivas_das_lContributorThanx for the script.IT's really useful...but i want that to be done using a single script..like we can add that script to a testsuite and whenever we run that suite....all the Request and Response get printed in a text file with a single click...
- omatzuraSuper ContributorHi!
well, that's not as easy, but still possible.. you would have to create a TestRunListener extension that intercepts all teststep executions, checks that the result is a WsdlTestRequestStepResult and logs the request/response accordingly. If you don't want this to apply to all teststeps run in soapUI, you could check for a TestCase property in the listener to enable/disable logging.. have a look at http://www.soapui.org/architecture/extensions.html to get going with soapUI extensions..
makes sense?
regards!
/Ole
eviware.com - BhuvanShanmugamContributorSrinivas,
Could you please let me know how you got on with ole's suggestion.
I am interested in having this logging feature at testsuite/project level as well.
Thanks,
Bhuvan.