Interview Questions

How to Save all TestStep's results into files ?

SoapUI FAQ


(Continued from previous question...)

How to Save all TestStep's results into files ?

To save the result (request data, response data, response time, etc.) of every executed TestStep in a Project, create a Project EventHandler (Project Window > Events tab > Add new EventHandler) of type TestRunListener.afterStep with the following content:

1.filePath = 'c:/users/henrik/soapUI-results/'
2.fos = new FileOutputStream( filePath + testStepResult.testStep.label + '.txt', true )
3.pw = new PrintWriter( fos )
4.testStepResult.writeTo( pw )
5.pw.close()
6.fos.close()

(Continued on next question...)

Other Interview Questions