Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 155873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:13:56+00:00 2026-05-11T10:13:56+00:00

We are currently using Watin to do UI testing on our web application. In

  • 0

We are currently using Watin to do UI testing on our web application. In effect we are doing integration testing from top to bottom since we are using a test database and not mocking.

In order to make sure the test database is in an expected state we have previously been using SQL Server’s snapshot feature to rollback the database at the beginning of each test. This is fairly slow and also causes an error immediately after the snapshot is restored.

Since each the tests are invoking the UI and potentially using multiple db connections, we have no way of start a transaction on each connection.

I was wondering if it is possible to somehow attach all database connections to a single transaction and roll them back at a later point? This would probably have to happen at the db level itself.

If anyone has any other suggestions on how to reset our test data for each UI test I’d love to hear your ideas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:13:57+00:00Added an answer on May 11, 2026 at 10:13 am

    If you fire up, in process, an instance of the Visual Studio development web server, and then run your WatiN test, then you can wrap the test in a single block like so:

    using (new TransactionScope()) {     var server = new Server(PORT_NUMBER, VIRTUAL_PATH, PHYSICAL_PATH);     server.Start();     try     {         using (var ie = new IE())         {             // TODO: perform necessary testing using ie object         }     }     finally     {         server.Stop();     } } 

    and all your database connections will in theory enlist in a single distributed transaction and their changes will all be rolled back when the TransactionScope is disposed.

    To run the dev web server in process, you will need to extract WebDev.WebHost.dll from the GAC and reference it in your project – this is the source of the Server class in the snippet above. Please let me know if you need more detailed instructions.

    You’ll need to make sure MSDTC is running, and if there are firewalls between you and the databases then depending on the port settings you may struggle. One added bonus of firing up the server in process is that WatiN tests can now contribute to measurements of code coverage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 160k
  • Answers 160k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In bash (>=4.2) it is preferable to use printf's built-in… May 12, 2026 at 11:40 am
  • Editorial Team
    Editorial Team added an answer If the example you posted is correct, then you have… May 12, 2026 at 11:40 am
  • Editorial Team
    Editorial Team added an answer \D is "non digit", which covers the whitespace between the… May 12, 2026 at 11:40 am

Related Questions

In my current project we are testing our ASP.NET GUI using WatiN and Mbunit
We are currently using a somewhat complicated deployment setup that involves a remote SVN
We are currently using the NetBios method , and it works ok under XP.
We are currently using unit tests to test our project. We have the majority

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.