cancel
Showing results for 
Search instead for 
Did you mean: 

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

deeOWU10
Senior Member

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/...

 

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.

 

 

 

1 REPLY 1
nmrao
Community Hero

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

If you are using testrunner utility provided by SoapUI, with right options, it will generate junit style report.

If use simple ant taget, and input the above generate junit report to this target, you will get nice html reports.

http://softwaretestersforum.blogspot.in/2013/03/generate-junit-style-html-reports-in.html


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Top Kudoed Authors