I have many tests in selenium that took almost 6 hours to complete. After the execution, few of them failed due to time-out error or unavoidable errors. I want to run only failed tests in that case. I am using teamcity to run the nunit tests. Any idea how can I rerun only failed tests.
There's an option to run failed tests first as part of TeamCity's nUnit integration - but you cannot limit it to only failing tests, nothing like this is built in.
You have a couple options here in my opinion:
There are a few options depending on the testing framework you are using so you can make teamcity launch tests on more flexible criteria by using command line options. We used this workaround in our instable test environment.
With NUnit it is possible to use the filtered outputfile (according to failed test) as the given testlist for the next run. There are various ways to fetch and set the list and you can find details here: https://github.com/nunit/docs/wiki/Console-Command-Line
There are two quick options:
With each run the list with tests should shrink.
Be aware:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With