In my earlier post we saw how we can get the NUnit runner with our Visual Studio 2010 ultimate.
Now let's look at how to generate reports in html format.
Steps invloved in generating a html report for nunit tests :
1. Download Nunit2report from http://sourceforge.net/projects/nunit2report/ and unzip it to a location just like in the screen shot
2. Download Nant from http://nant.sourceforge.net/ if you don't have already place it in a location suitable to you
3. Once you are in Nunit2Report bin directory - You must have these files just like i have in screen shot
4. Copy all files from the bin directory of Nunit2Report to Nant/bin directory - Just as in screen shot
5. Add reference to Nant with Visual Studio 2010
6. Click on Tools Menu in Visual Studio and click on External Tools - Just like in Screen shot
7. Add details just like i have entered in the external tools configuration for nant
8. You can either follow step 7 for integrating Nant with Visual studio or just create a batch file with details $NANT_HOME\bin\nant.exe -buildfile
9. Let's look at how our build file looks - Have a look at the screen shot
10. You should see a nice html report - Just like screen shot
11. We can add a task to email results as well using the mail task
Hi Shabana, thanks for posting this. Could you please tell me where to save this Build file in Step 9? I saved it under the project folder/bin but it never created any HTML report. Any help you provide is much appreciated!
ReplyDeleteShabana, Please check the point no 9 which has snapshot if the build file. I hav created the .build file and am able to generated the HTML report
DeleteThanks to the Author for posting it step by step
@VG : It would be in your solution
Delete@Kiran, thanks that you felt it was of help to you :)
Deletei am unable to generate reports ....can any one help me out how to generate HTML report in detailed ........
ReplyDeleteHi can anyone suggest me how to generate HTML reports using Nunit only.
ReplyDeleteSory .. for not replying on time
DeleteDid you follow the exact steps .. please be specific as to where you are seeing error
Thanks dude i am getting it...@VG place your batch file in /bin/debug.
ReplyDeleteVery nice piece of code. Able to generate report by simply following the steps.
ReplyDeleteThis was really required. Thanks a lot.
Hi
ReplyDeletePlease answer my queries
1. do we require build.xml if yes where to place it (specific location)
2. where we will get the .html file
if u can paste code it will be beneficial
Thanks
Once we unzip Nunit2report . where exactly we need to place this .? C drive .? D drive .? Where .?
ReplyDeleteI need few clarifications here, Please find the below points:
ReplyDelete1. At step 9 you have mentioned "Our build file looks like this" and you have provided the screen shot. Should we have to manually write that build file u have shown in the screen shot and place the file in a specific location? If yes, please specify the location.
2. How do I run my Nunit tests to generate the HTML reports?
I run my Nunit test by going to test explorer and by selecting all the tests I want to run and then I select "Run Selected test". Should I be following this or anything else to generate the report?