4

In our test environment, there are some tests that fail irregularly on certain circumstances.

So my question is, what can be done to rerun the failed Nunit tests only.

My idea is implement some steps in the Nunit TearDown to re-run the failed test as below

[TearDown] 
public void TearDownTest() 
{ 
  TestStatus state = TestContext.Status; 
  if (state == TestStatus.Failed) 
  { 


  // if so, is it possible to rerun the test  ??



  } 


} 

My requierment is - I want to try to run my failed test at least three times, if it fails for first and second time

Can anybody suggest your thoughts on this

Thanks in advance

Anil

anil
  • 117
  • 1
  • 1
  • 7

1 Answers1

0

Instead of using the teardown, I'd rather use the xml report, use some xslt to figure out the failing fixtures and refeed them to a build step running the tests.

rcaval
  • 762
  • 5
  • 12
  • Can you please guide how to figure out failing tests and re feed them to build step. As I need to do same. Any reference link would be highly appreciated. – sam Sep 09 '14 at 09:34