cancel
Showing results for 
Search instead for 
Did you mean: 

How to customise JUnit html report to include request and response for failed cases

Highlighted
Occasional Contributor

How to customise JUnit html report to include request and response for failed cases

I have around 2500+ test cases organised under 40 testsuites, which are running via cli by Jenkins and default JUnit style report is hosted at a url. Sometimes, it is pretty difficult to look at the assertion fails and learn about the error. So, I am planning to include request and response in the report for the failing test cases. I know, there are quite a few documents available, but are not easy to understand. Anyone with a simpler and swift solution? Currently, the default report gives, Name, Status, Type and Time columns for failed test cases, I just need the same format, but Name, Status, Type, Request, Response and Time.

10 REPLIES 10
Community Manager

Re: How to customise JUnit html report to include request and response for failed cases

Hi Gurbakhsish,

 

You will need to create a custom template for your report. Refer to the following article - it contains a detailed description (with some samples) of how this can be done:

http://readyapi.smartbear.com/readyapi/reporting/templates/customizing

 

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Occasional Contributor

Re: How to customise JUnit html report to include request and response for failed cases

Hi, @TanyaGorbunova , I knew this link is coming as the reply to my question. I am finding a bit difficult to follow the limited set of instructions there, for example, 

1. I just want to modify the JUnit Report to include Request and Response, as mentioned in the attached screenshot.

2. I have no idea the default JUnit Report fetches which Available Reports?Or do I need to add a new Report all together?

3. Information to use Report parameter is too limited.

Community Hero

Re: How to customise JUnit html report to include request and response for failed cases

Community Hero

Re: How to customise JUnit html report to include request and response for failed cases

By the way, having request and response would be too heavy.

For example there is a test case with 30 steps, 20 steps out of it are requests and rest of the steps are jdbc or groovy.

I can't image how weird that reports looks like for a test case, then suite.


Regards,
Rao.
Occasional Contributor

Re: How to customise JUnit html report to include request and response for failed cases

Hi, @nmrao,  I think one needs to have some bit of expertise in jasper reports in order to customise them. I know my requirements and I have maintained my 2500+ test cases such that, there is no test case having 30 test steps, using setup and tear down efficiently(without any jdbc requests). And what I want to fetch request and response is only for failed step and not all of them, as the default JUnit report shows only failed test steps.

 

And, thanks for the links, but I am not able to follow them. Are there any online tutorials/videos for report customisation?

Community Hero

Re: How to customise JUnit html report to include request and response for failed cases

30 steps was an example. There can be any number.

Unfortunately, it requires coding , writing stylesheets in order customize if your requirements not meet.


Regards,
Rao.
Community Hero

Re: How to customise JUnit html report to include request and response for failed cases

Here is another thread from old postings, have a look.

https://community.smartbear.com/t5/SoapUI-Open-Source/Customizing-JUnit-Report-for-Data-Driven-tests...


Regards,
Rao.
Occasional Contributor

Re: How to customise JUnit html report to include request and response for failed cases

yes, I agree, but I am amazed that no where in the community, such question is answered in a step by step manner. Which I think Smartbear should look into, and provide some sort of training or online videos to teach people to customise reports.

Community Hero

Re: How to customise JUnit html report to include request and response for failed cases

There are some free trainings are lined up please check the forum.
May be you can be the first to raise it.

And by name customization, and I believe that no two customer likes the same customization.

In the second link of the earlier reply has the steps, but you may have different requirements.


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