Forum Discussion

Tindra's avatar
Tindra
Occasional Contributor
12 years ago

[Resolved] Customized JUnitReport

Hi,

We are currently trying to add more information of failed test cases into the JUnit report that soapUI creates.
The report itself gets aggregated to our CI-environment and it would be nice to present more information in the test cases in the same place.
However we are triggering the execution via SoapUIProTestcaseRunner like this (pseudo):

SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner();
runner.setProjectFile("myPath");
runner.setJUnitReport(true);
runner.setPrintReport(true);
runner.setOutputFolder("myOtherPath);
runner.run();

And the code is run from a JUnit-wrapped Java class.
Now the question is how to insert more information to the failing test cases into the JUnitReport.
I've looked into this thread: https://www.eviware.com/forum/viewtopic ... dea#p40107
And this blog: http://blog.infostretch.com/customizing-soapui-reports
But with no luck.

The nicest solution would be to extend the JUnitReportCollector (or the JUnitSecurityReportCollector??) and add the messages that we want to the failing test case.
However I cant really figure out howto instantiate the customized ReportCollector to the runner.
Since the SoapUIProTestcaseRunner is extending the SoapUITestcaseRunner there is not possible to override method from the SoapUITestcaseRunner.

So I'm a bit stuck with this.
Question is: How to customize the JUnit report programmatically when using SoapUIProTestcaseRunner?

Regards
  • Tindra's avatar
    Tindra
    Occasional Contributor
    Yes, since they get parsed by jenkins in a seamless way to our CI environment.
  • AAichholzer's avatar
    AAichholzer
    Occasional Contributor
    Hi, i have the same problem like Tindra

    As i understand, there is no way to change the report by extending JUnitReportCollector class like in the free version?

    If not, how can i add additional information to the jUnit report??

    -> I need to write a custom testcase property to the jUnit report

    best regards

    Horst
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Just checking in to see if the plugin that heols provided solved your problem

    Best regards,
    Mikael
    SmartBear Support
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    hi,
    you can extend the SoapUIProTestCaseRunner class and override the createJUnitSecurityReportCollector method to return a new instance of your custom implementation of a JUnitSecurityReportCollector
    This is what is done in the maven plugin (see https://github.com/redfish4ktc/maven-so ... r.java#L76) which addtionnaly let the user specify the implementation of the report collector by setting a java system property (this also work with the free runner)