Recording test failures

Integrating LiveRecorder for recording tests can be achieved in three ways:

  1. Record all tests and generate one recording file per failing test class. This is the easiest of the methods to integrate, but will significantly slow down your test runs since everything is recorded.

  2. Record all tests and generate one recording file per failing test method. This method is useful for recording intermittent test failures. You will need to arrange in your test class(es) for your intermittently failing test(s) to be re-run until they fail.

  3. Run all tests, and re-run failing test methods under recording. This method does not slow down successful test runs, and so is useful for recording failures in everyday test automation scenarios.

When using the LiveRecorder API, care must be taken to ensure that only one recording is being made at a time. You cannot have a test in one thread start a recording and then a test in another thread attempt to also start a recording. The default for Maven for instance is single-threaded so in that case it is just a question of making sure you don’t use the parallel mode of operation.

For examples that demonstrate LiveRecorder’s use under some well-known frameworks, see below: