This project is read-only.
The project is actively maintained at

Project Description
Transacts all changes to a website to facilitate automated UI testing. Queries from the automated test can also query the application database without blocking and participate in the transaction.

Using transactions with an automated test is not typically a problem in situations where the code being tested runs in the same process as the test runner. However, transacting UI tests of a web application is challenging because the tests do not run in the ASP.NET worker process.


Amnesia makes this possible by using a distributed transaction between an automated test running in a testing tool, like Visual Studio, and a ASP.NET application so all actions performed by the test are rolled back at the conclusion of the test.


Example Usage (mstest)

public void MyUiTest()
    using(new Amnesia.Session(urlToWebsite))
        // perform actions against the web app here
        // and all database writes are rolled back at the
        // conclusion of the test

You can also utilize Amnesia with test recorders: Using with a test recorder

Setting up Amnesia

Integrating into an application
Workstation Configuration

Getting Started

In order to use Amnesia an application must utilize the TransactionScope class for its transaction management.

This project was inspired by Graeme Hill's blog post on the topic: High performance database rollback in automated tests with SQL Server.

VC3 Open Source

Last edited Nov 6, 2013 at 9:59 PM by matthooper, version 21