Persistent Data State

Because the same actions are being repeated in the record and replay phases, issues can arise because of the state of the database. For example, if you added something with a unique identifier, the replay phase can fail with a duplicates exception.

You could back out the database changes manually, using your application after each record or replay session. For example, you could bring up a "vanilla" copy of your application and modify the data so that the replay action will work, or you could record your GUI actions again.

For simple testing scenarios, you may be able to simply record the adding of the unique item and deleting it all in one profile class. With this technique, you can record and replay any number of times without getting duplicates exceptions.