HOW TO TEST AND DEBUG AN ASP NET
HOW TO TEST AND DEBUG AN ASP. NET APPLICATION By S K Yasho Vardhan Upadyayula Presentation Id: 9
Outline ■ How to test an application Using the ASP. NET Development Server ■ How to test an application using IIS ■ How to use the Debugger
Testing An Application with Default Browser order page displayed in the browser
v Three ways to run an application with debugging • • click start debugging button in standard toolbar Press F 5 Choose debug->start debugging command v Three ways to run application with out debugging • press cntrl+F 5 • choose Debug->Start without debugging • v Right click a page in solution explorer and choose in browser view Three ways to stop application that runs with debugging • press shift+F 5 • click stop debugging button in debug toolbar • choose debug ->stop debugging
Testing an application with the browser other than default v Two ways to test an application ■ Right click on the starting page of the application then choose browse with from shortcut menu then a dialog box is displayed from that choose the browser you want to use. ■ Select the browser you want use and set it as default browser. The next time you run an application it will be displayed in the selected browser
■ Browse with dialog box
Description ■ Initially it is required to test the ASP. Net application ■ If the browser is not included then find it in the list of available browsers through the browse option. ■ If we need to the default browser and to use debugger then browse with the command start the application with out debugging
How to use exception assistant ■ If an unhandled exception occurs then the application enters breakmode and exception assistant is displayed as in the below dialog box. ■ Exception assistant gives the name and description of the exception. ■ If you continue to execute the program execution even after the exception then ASP. Net terminates and sends a server error page
An exception assistant dialog box
How to test application using IIS ■ Dialog box for selecting local IIS website
§ To create a IIS new site select HTTP option in the new dialog box and then enter the path of the IIS directory where you want to create the website § Else click the browse button and find the location. § From choose location dialog box click local IIS button and expand default website § To create new IIS directory for website, click create new web application and enter name of the directory. Then the files will be stored in the directory. § To create virtual directory for website , create new virtual directory and enter name of the directory and path where you want to store the files.
v Limitations Of ASP. NET Development Server: • Can serve pages only to local computer • Runs in current user’s security context it does not test exact solutions ■ Uses a specific chosen port rather than standard http port
How to test an application from outside of visual studio ■ Once you tested an application with in the visual studio you have to test it outside the visual studio also. ■ Open the browser you wish and then enter the Url of the application and then press enter. ■ Be sure whether the application provides any concurrency errors. ■ Use debugger for testing the concurrency errors , we can run one application with in the debugger and the other from outside the debugger.
Order page displayed outside the visual studio
How to use debugger how to use breakpoints ■ As we start an application it is necessary to set the break point before executing the application. ■ After setting an breakpoint and then run the application it automatically enters the breakmode ■ To remove the breakmode remove checkmark infront of the breakpoint.
Order page with the breakpoint
Setting and clearing breakpoints ■ To set breakpoint click the indicator bar on the left of the statement to set the breakpoint ■ To remove breakpoint click breakpoint indicator and then click remove all breakpoints once ■ To disable all breakpoints use debug and disable all breakpoints windows and we can even enable the breakpoints ■ To display breakpoints window use debug->windows >Breakpoints command
- Slides: 18