Forum Discussion

Mehman87's avatar
Mehman87
New Contributor
6 years ago

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

  • Hi Mehman87 ,

     

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

  • Hi Mehman87 ,

     

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

    • Mehman87's avatar
      Mehman87
      New Contributor

      Thanks for your help on this HimanshuTayal 

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

       

      Thanks

      • JHunt's avatar
        JHunt
        Community Hero

        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"
        
            }
                 
        }