Click here to Skip to main content
13,248,112 members (39,960 online)
Click here to Skip to main content
Add your own
alternative version


13 bookmarked
Posted 26 Apr 2006

Performance Scripting ASP.NET

, 26 Apr 2006
Rate this:
Please Sign up or sign in to vote.
An article detailing a custom ASP.NET performance testing application.


Earlier this year I needed to assist with performance tuning one of our company’s ASP.NET applications.

I had a play with Microsoft Application Center Test. Although the application was easy to script and use, I didn’t like the scripting language and its extensibility.

What I really wanted was an application that allowed me to integrate some of our existing .NET classes. I decided to implement an application similar to Microsoft ACT within .NET, written in C#.

How it works

There are 3 main components to the application.

  1. A client is required to connect with the web application generate a script based on the requests that the web application receives.
  2. An HTTP Module is responsible for recording the requests and sending the information for a request back to a client.
  3. A test agent is required to execute test scripts once they have been generated.

The solution

The solution contains 5 projects:

This is the HTTP Module that transfers request information.

This is a WinForms application that connects to the BUG and generates the test script.

This is used for executing test scripts execution.

This is a library of helper classes and methods.

This project exists to contain any test scripts that have been generated.

How to create a new test

  1. Recompile the WTC.sln
  2. Copy the BUG\bin\debug contents to the bin directory of the web application that is to be scripted.
  3. Modify the web application’s web.config file to include the httpmodule section as per BUG\README.txt
  4. Launch the SPY application
    • The first textbox is the tcp port that the SPY will listen on for connections from the web application that is being trapped (this should not need to be altered)
    • The second textbox must contain a valid aspx page of the web application that is being trapped.
    • Replace URL is the initial portion of the URL that may differ between servers.
    • Class Name is the name of the C# class that will be generated when “Build” is selected.
    • Display Name is the name that will appear in the Agent program.
  5. Click Start
  6. When the Stop button has become enabled, scripting may begin for that web application.
  7. Launch a new instance of Internet Explorer and type in a valid URL for the web application.
  8. For each request that is made, a new item is added in the listbox. A description may be entered to make test results more meaningful when they are executed. The description will not be changed until the enter key has been pressed.
  9. When the script has been generated, click Stop. At this point, the script may be saved using File->Save. An existing script may be opened using File->Open.
  10. After the SPY has been stopped, click “Build”. The interface will change to display a C# script for executing the test.
  11. Cut and paste the code into the MI6Camp project. This is the assembly used for all test scripts.

How to execute a test

  1. Launch the Agent application.
  2. Click Edit->Add Test (or press the Insert button on the keyboard)
  3. A list of available tests will appear.
  4. Select the test(s) that are to be executed and click Accept.
  5. The test(s) selected will now appear in the main UI.
  6. Click on the item in the list to view or set its properties
  7. After setting the properties, add more tests or prepare for a test run.
  8. Before executing a test run, it is recommended that the test settings be saved for future replication of a test. Click File->Save. (A feature also exists for Opening an existing test).
  9. Click Execute->Run (or press F5) to perform a test run.
  10. Enter the name of the log file and click Start.
  11. The test will run in the background appending to the log file until it completed or the Stop button is clicked.
  12. The log file contains the results of the test run.

Note: The on-screen results may be collated to a different format using the “Collate Results” button.


This application is slightly different from many other performance test applications in that it only traps requests that go through the ASP.NET IIS filters.

A couple of us within our company used this application to performance test and consequently tune our application. I hope that others can find it similarly useful.

I have been told that Microsoft Team Suite – Test Edition provides a lot of the same functionality (although I have not yet seen a copy of it so I can not comment).


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Simon McEnlly
Web Developer
Australia Australia
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionCode? Pin
tkrafael_net27-Apr-06 7:36
membertkrafael_net27-Apr-06 7:36 
AnswerRe: Code? Pin
Simon McEnlly27-Apr-06 18:54
memberSimon McEnlly27-Apr-06 18:54 
GeneralRe: Code? Pin
Ch][mera20-Feb-07 4:15
memberCh][mera20-Feb-07 4:15 
GeneralRe: Code? Pin
Ch][mera20-Feb-07 4:15
memberCh][mera20-Feb-07 4:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171114.1 | Last Updated 26 Apr 2006
Article Copyright 2006 by Simon McEnlly
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid