How do I unit test web pages/sites in Visual Studio 2008?

Posted on 2009-12-16
Last Modified: 2013-12-13
I am a newbie to automated unit tests. We develop web stuff in VB using Visual Studio 2008. I have recently become convinced of the benefits of Test Driven Development and so would like to learn how to do this. I am aware that NUnit is an option but it would seem more sensible to use the stuff built into VS. I understand how to target unit tests at classes in *.vb files but I can't find any info anywhere as to how to target tests at web pages and their code behind (aside from using 'macro' records like Selenium). The best I have found is but this doesn't really get me very far.
Can anyone give me solid examples or point me at a tutorial?
In the first instance I would like to create a unit test to fail, then create a simple aspx web page with, say, a button and some code behind, and instantiate this into the unit test to then pass the test.
Question by:ddl_ex5
    LVL 10

    Accepted Solution

    Please take a look at the following link.

    Unit Testing ASP.Net Applications with Visual Studio 2008
    LVL 9

    Expert Comment

    Just a reminder. You need to have Visual Studio 2008 Team Suite or Test Edition to have the "test" menu appear in VS2008.

    Author Closing Comment

    Exactly what I've been googling for for days!! Thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
    Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
    The viewer will learn how to dynamically set the form action using jQuery.
    XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now