Ask a Question

Generate a Report after running a Testsuite

SOLVED
Mehman87
New Contributor

Generate a Report after running a Testsuite

I have set up a Testsuite with 17 testcases. Rather than going into each case to see the output, i would like to print the Output (responses) into 1 file. 

 

Is there a way to do this, and if so, how? Im using SoapUI version 5.4.0 Free Version

 

Thanks in advance

3 REPLIES 3
HimanshuTayal
Community Hero

Hi @Mehman87 ,

 

Yes it can be achieved by writting custom groovy code. Let me know if you need help on this.


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

Thanks for your help on this @HimanshuTayal 

Are you able to send me an example of the code required please?

 

Thanks

Start with something basic like this in the TestSuite Teardown Script. Expand it as required:

 

import com.eviware.soapui.impl.support.http.HttpRequestTestStep

File out = new File("/temp/blah.txt")

testSuite.testCaseList.each {
	
    it.testStepList.findAll { it instanceof HttpRequestTestStep }.each { 

        out << "${it.testCase.name} -- ${it.name}" + "\n"
	out << it.httpRequest.requestContent + "\n\n"
	out << it.httpRequest.response.contentAsString + "\n\n"

    }
         
}
cancel
Showing results for 
Search instead for 
Did you mean: