Forum Discussion

ustim80's avatar
ustim80
Occasional Contributor
9 years ago

set filename by report generating

I try to generate report in testRunListner.afterRun and have to save it with the same name like test case name.

I found an example to do it but generated report has always the same name: "Testcase Report.html"

How can I set file name for report generating? Any ideas?

I guess this could be done via first parameter for generate method or via changing some properties of availableReport but how?

 

import com.eviware.soapui.reporting.ReportEngineRegistry
import com.eviware.soapui.reporting.reports.testcase.*

def report = new WsdlTestCaseReport(context.testCase)
def availableReports = ReportEngineRegistry.getAvailableReports( report  ) // get list of all reports for test case

availableReports[0].generate( report.getModelItem().getSettings(), (String[])[ "HTML" ], "c:\\Users\\User01\\Documents\\Reports")
availableReports[0].release()

1 Reply

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Ustim80,

     

    I have never faced this situation. Perhaps, Ready! API doesn’t support custom names :(

    @Community, can you suggest any solution?