ASP.NET
  Home arrow ASP.NET arrow Page 2 - How to Test a Web Application
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

How to Test a Web Application
By: Murach Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2009-07-02

    Table of Contents:
  • How to Test a Web Application
  • How to test a web application
  • How to review the HTML that’s sent to the browser
  • Perspective

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    How to Test a Web Application - How to test a web application


    (Page 2 of 4 )

    After you design the forms and develop the code for a web application, you need to test it to be sure it works properly. Then, if you discover any errors in the application, you can debug it, correct the errors, and test it again.

    In chapter 4, you’ll learn all the skills you need to test and debug a web application. For now, I just want to show you how to run a web site with the built-in development server so you can test any applications that you develop for this chapter. Then, I’ll show you the HTML code that’s sent to the browser so you can see how that works.

    How to run a web site with the built-in development server

    When you run a file-system web site by using one of the techniques in figure 2-18, Visual Studio 2008 compiles the application. If the application compiles without errors, Visual Studio automatically launches the built-in ASP.NET Development Server and displays the starting page of the web site in your default browser. Then, you can test the application to make sure that it works the way you want it to.

    However, if any errors are detected as part of the compilation, Visual Studio opens the Error List window and displays the errors. These can consist of errors that have to be corrected as well as warning messages. In this figure, five errors are displayed in the Error List window. These errors occurred because I set the Option Strict option on.

    To fix an error, you can double-click on it in the Error List window. This moves the cursor to the line of code that caused the error in the Code Editor. By moving from the Error List window to the Code Editor for all of the messages, you should be able to find the coding problems and fix them.

    Note that the code that caused the errors is also identified with a wavy underline in the Code Editor. In fact, the errors shown here were highlighted before I compiled the application. Visual Studio doesn’t detect some errors until the application is compiled, though.

    If a bar appears at the right end of the wavy underline that identifies an error, it means that the Smart Compile Auto Correction feature is available. Then, you can place the mouse pointer over this bar to display a smart tag, and you can click the drop-down arrow that appears to display an Error Correction Options window like the one shown in this figure. This window includes a description of the error, suggestions for correcting the error, and a preview of how the code will look if you apply the corrections. If you like a suggested correction, you can just click on it to apply it.

    As you’re testing an application with the development server, exceptions may occur. If an exception isn’t handled by the application, ASP.NET switches to the Code Editor window and highlights the statement that caused the exception. In this case, you can end the application by clicking on the Stop

    An ASP.NET project with the Error List window displayed

    How to run an application

    1. Click on the Start button in the Standard toolbar or press F5. Then, the project is compiled and the starting page is displayed in your default browser.
    2. The first time you run an ASP.NET application, a dialog box will appear asking whether you want to modify the web.config file to enable debugging. Click the OK button to proceed.

    How to stop an application

    • Click the Close button in the upper right corner of the browser. Or, if an exception occurs, click the Stop Debugging button in the Debug toolbar or press Shift+F5.

    How to fix syntax errors

    1. If any errors are detected when the project is compiled, an Error List window is opened and a list of errors is displayed along with information about each error. To display the source code that caused an error, double-click on the error in the Error List window.
    2. Syntax errors are highlighted in the Code Editor window with a wavy underline. If a bar appears at the right end of the underline, you can place the mouse pointer over the bar, then over the smart tag that’s displayed, and click the drop-down arrow to display the Error Correction Options window. 
       
    3. To correct an error, you can click the appropriate “Replace…” link in the Error Correction Options window, or you can enter the correction yourself.

    --------------------------------------------Figure 2-18   How to run a web site with the built-in development server

    Debugging button in the Debug toolbar or using the Debug->Stop Debugging command. Then, you can fix the problem and test again.

    In chapter 4, you’ll learn all of the debugging skills that you’ll need for more complex applications. For simple applications, though, you should be able to get by with just the skills you have right now.

    More ASP.NET Articles
    More By Murach Publishing


     

    Buy this book now. This article is an excerpt from chapter two of Murach's ASP.NET 3.5 Web Programming with VB 2008, written by Anne Boehm (Murach, 2008; ISBN: 1890774472). Check it out today at your favorite bookstore. Buy this book now.

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek