Forum Discussion

deeOWU10's avatar
deeOWU10
Senior Member
9 years ago

How would I go about generating a TestSuite report using a groovy script?

Is there a way to perform auto generation of a testSuite Report from a groovy Script?

 

More specifically I have a TearDown groovy script that executes I want the report to generate before the TearDown occurs. I found on the boards this topic matter :

 

http://community.smartbear.com/t5/SoapUI-NG/how-to-generate-coverage-reports-via-groovy-script/td-p/10433

 

this was helpful in finding the GeneratableReports class. I was able to successfully get the list of all the testSuite Reports, but the .generate() method is not working. I do not want to utilize the coverage report object either.

 

 I am not receiving any errors however no report is generating. I have this method defined in my Teardown Script similar to the solution from the above forum:

 

def reportGeneration(log, runner, context, testSuite) {
 
  def report = new WsdlTestSuiteReport(context.testSuite)
  log.info "report: ${report}"
     def availableReports = ReportEngineRegistry.getAvailableReports( report  ) // get list of all reports for test case
  log.info "available reports: ${availableReports} "
     log.info "available reports: ${availableReports[4]}"
  
  
         // generate 2nd , format PDF ( here you can add other formats ), at location "directory"
      
      availableReports[4].generate( report.getModelItem().getSettings(), (String[])[ "PDF" ], "directorypath")
   //log.info "generation:  ${result}"
         availableReports.release()
 
 }

 

in soapUI interface when in the test suite TearDown Script tab I have this string for SoapUI to find this method:

 

context.acqTestSuite.reportGeneration(log, runner, context, testSuite)

 

 

I am not  sure what I am doing incorrect any help would be greatly appreciated.