2

Whenever an NUnit test fails during its execution (i.e. not when using Assert.*), I want to log additional information (I'm writing web tests and I am especially interested in the web page's current DOM).

How to specify a global exception handler in NUnit which is able to log additional information on NoSuchElementExceptions - test should still fail of course.

D.R.
  • 20,268
  • 21
  • 102
  • 205

1 Answers1

1

You could write an NUnit event listener addin that logs the information. See http://www.nunit.org/index.php?p=nunitAddins&r=2.6.3 and http://www.nunit.org/index.php?p=eventListeners&r=2.6.3. For a tutorial, see https://www.simple-talk.com/dotnet/.net-tools/testing-times-ahead-extending-nunit/.

Fabian Schmied
  • 3,885
  • 3
  • 30
  • 49