Retry policy to allow a NUnit test to retry if the given exception thrown is a retry exception type.
$ dotnet add package RetryOnExceptionNUnit extension that catches exceptions and allows the test to be retried using the NUnit Retry Attribute; Very useful for Selenium UI automated tests.
Get the package from Nuget
[Test]
[RetryOnException(ListOfExceptions = new[] { typeof(Exception)})]
[Retry(5)]
public void Test()
{
...
}
###Examples of exceptions [RetryOnException(ListOfExceptions = new[] { typeof(NotSupportedException), typeof(NullReferenceException) })]