Generate dynamic JUnit reports in soapUI

Today, in continuation with my earlier post on Generate JUnit Style HTML reports let us see how to generate soapUI HTML reports dynamically.

JUnitReport Task will merge the XML files generated by JUnit task and will apply a style sheet to generate HTML results. The stylesheets applied would be either junit-frames or junit-noframes.
The frames format uses a stylesheet which is generating output only by redirecting. In this case the test result file name would be index.html.

The noframes format does not use redirecting and generates one single file called junit-noframes.html.

I have been using noframes format to generate soapUI HTML reports. On generating the HTML report  each time, it will be overwriting the existing junit-noframes.html report. If I am not wrong, we don’t have any other option yet in JUnitReport to change the default report name but no worries..luckily we have a work around in our plate that would help us to achieve complete automation.
Well, let me explain it...
In the build.xml file add the following timestamp property.





Then add a move task just below your junitreport task to rename the generated junit-noframes.html file dynamically to your desired file name along with the timestamp as shown below:







This should take out the test result naming dependency and should help you in generating test results dynamically.

Do let me know if this article proved to be useful by dropping in a line below and do keep visiting Software Testers Forum for solutions. Happy Testing..!!

Technorati Tags: ,,,,,,,,,,,,,,,,,,,,
Generate dynamic JUnit reports in soapUI Generate dynamic JUnit reports in soapUI Reviewed by Suntaragali The Smart Techie on October 14, 2013 Rating: 5

7 comments:

  1. Yes...it worked...thanks a tonn!!!

    ReplyDelete
  2. Thanks for this, I used this to help a user on StackOverflow, I gave you credit ;), see http://stackoverflow.com/questions/32324307/customized-html-report-name-in-junitreport-task

    ReplyDelete
  3. Is there any way to print testSteps in junit reports?

    ReplyDelete
    Replies
    1. Amit - For now I don't see any possibilties.. will have to try. As a workaround,instead of having multiple tests steps in one test case, try putting each test step in its own test case. In that way you should be able to see the test steps in the generated HTML report.

      Delete
  4. Hi Suntaragali,
    Thanks for sharing this and it's very useful for us.

    I have one question here.

    Is there any way to capture response of the API and include the same in report?

    I see its happening if its failure??. can we do it for 200 OK status too.?

    Please help if possible.

    ReplyDelete
  5. GB WhatsApp APK Download Latest Version 2024 Anti Ban You Can Use GB Whatsapp OFFICIAL With Extra Features Without Any Temporary Ban issue.
    GB Whatsapp APK

    ReplyDelete
  6. Download GBWhatsApp Download APK Latest Version 2024 Anti Ban You Can Use without Any Temporary Ban issue Enjoy Latest GB Whatsapp OFFICIAL With Extra Features.
    GB Whatsapp APK

    ReplyDelete