Forum Discussion

soapuinoviceuse's avatar
soapuinoviceuse
Occasional Contributor
12 years ago

Customizing JUnit Report for Data Driven tests

Hi All,

I have a SOAP UI test that is Data Driven and once the tests are run, the Junit reports are generated at test case level. What I need is to have a report that shows pass/fail for each entry in my input data.

I referred to the below links:
viewtopic.php?f=2&t=20827
https://github.com/redfish4ktc/maven-so ... it-reports

And followed the below steps :
1. Installed maven and created a test project using maven (this generated respective project folder 'app' along with pom.xml file)
2. Modified pom.xml to include pluginRepositories, groupId and artifactId of maven-soapui-pro-plugin
3. Updated pom.xml with my soapui project xml, output folder for reporting and set junitreport tag as true
4. After this, I could run my SOAP UI project using maven commands using the specific goal

As mentioned in above maven-soapui-plugin wiki, I have added <soapuiProperties> tag to include the new overridden instance of JunitReportCollector.
Now, I am going to use the same overridden JunitReportCollector class as specified in thread : viewtopic.php?f=2&t=20827

I am stuck at where I should create this overridden instance of JunitReportCollector class ? should I compile and create a jar of this file and place in SOAPUI Home/bin/ext folder ?

Any help is really appreciated.

Thanks.

My question is where I should create this overridden instance of JunitReportCollector

13 Replies

  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    I've found a way to compile the java class with soapui 4.5.1, see my post in viewtopic.php?f=2&t=20826&p=48038#p48038

    So now my pom is like the following

    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <dep.version.soapui>4.5.1</dep.version.soapui>
    </properties>

    <dependencies>
    <dependency>
    <groupId>eviware</groupId>
    <artifactId>soapui</artifactId>
    <version>${dep.version.soapui}</version>
    </dependency>
    <dependency>
    <groupId>eviware</groupId>
    <artifactId>soapui-pro</artifactId>
    <version>${dep.version.soapui}</version>
    </dependency>
    <dependency>
    <groupId>eviware</groupId>
    <artifactId>ext-xmlbeans</artifactId>
    <version>1.2</version>
    </dependency>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.11</version>
    </dependency>
    </dependencies>
  • Hi All,

    I am also trying to modify the JUnitReportCollector and have added to write the test step results when a Success happens.

    I tried to modify the TestCase class to add the success, but failed ... If I add the "report.addTestCase" it only displays the Success on the "Status" and inside the "Type" it dose not print the step results. Would any one please guide how to add the step results details to the Success Test Case.

    For the time being I have used the below step in (afterRun) and getting the required results , however the "Status" for a passed test case shows as "failure" (attached the screen shot ). I want the "Status" to show as Success

    "
    if (TestRunner.Status.FINISHED == testRunner.getStatus()) {
    String msg = "";
    if (this.status.containsKey(testCase))
    {
    msg = ((String)this.status.get(testCase)).toString();
    }
    report.addTestCaseWithFailure(testCase.getName(), testRunner.getTimeTaken(), "This is Added for PASSED TestCases" , msg);

    }

    "
    Please let me know how to add this steps and what should go there in the successDocument file...
    com.eviware.soapui.junit.SuccessDocument.Success success // please share what should go here .... and do we need to change the TestStep class too .....
    // = testcase.addNewSuccess();
    System.out.println("SUCCESS TO REPORT");
    // report.addTestCase(testCase.getName(), testRunner.getTimeTaken());


    Thanks,
    manoj