Hi,
When I am running testcases via NUnit, where should I add the
try{}
catch{Exception e}
Report.Screenshot();
so that I will receive the screenshot if something goes wrong in my testcase?
If I add it to this [test], NUnit will pass the test in case of failure.
p.s. Does anyone here know, how to use NUnit2Report to make readable reports from NUnit genereded Testresults.xml?
NUnit + Exception
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: NUnit + Exception
Hi!
Regards,
Peter
Ranorex Support Team
Just add a try-catch block over the code that can throw an exception (like you would do it in a normal Ranorex Console Application) and re-throw the exception at the end of the catch.SanMan wrote:so that I will receive the screenshot if something goes wrong in my testcase?
catch (YourException e) { Report.Error(e.ToString()); Report.Screenshot(); error = -1; throw; }
Sorry we don't have experience with NUnit2Report.SanMan wrote:Does anyone here know, how to use NUnit2Report to make readable reports from NUnit genereded Testresults.xml?
Regards,
Peter
Ranorex Support Team