asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search








Active News
15 Seconds Weekly Newsletter
• Complete Coverage
• Site Updates
• Upcoming Features

More Free Newsletters
Reference
News
Articles
Archive
Writers
Code Samples
Components
Tools
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

HardwareCentral
Compare products, prices, and stores at Hardware Central!

Load Down: Application Center Test
By Brian Quinn
Rating: 2.9 out of 5
Rate this article


  • email this article to a colleague
  • suggest an article

    The Load Down

    Anyone who has used Microsoft's Web Application Stress Tool (WAST) to load-test an ASP application has noticed its one flaw -- you cannot take a dynamic variable from one page and pass it on to the next.

    Here's an example:

    The registration page at your site inserts all the users' details into a database table, and this table returns a unique Customer ID to the registration page. This ID is then required when placing a new order in the basket checkout page.

    If you wanted to run a complete test, including registering a user and then getting that user to place an order, you would run into problems. You need to get that new user's registration ID and pass it into the basket checkout page, but WAST simply does not give you that level of functionality.

    Fear not! Those nice folks at Microsoft have come up with a new load-testing tool. The interestingly titled Application Center Test (or ACT) has been the development focus of the WAST team for some time now and was bundled with the recent Visual Studio.NET Beta (see http://msdn.microsoft.com/vstudio/nextgen/default.asp).

    The package encompasses its very own scripting language called Active Test Script (ATS) that allows programmatic control of HTTP requests, responses, etc. ATS is just VBScript so writing test code should be no problem to ASP developers. The current version of Application Center Test (ACT) is still in beta and is missing some of its release features, mainly the ability to use multiple test computers when running simulations. You could always install ACT on several machines and then run around your office like a crazed postal worker trying to get them all running at the same time. Although this will not be an issue if you are running long tests, the benefit of this early ACT version is that it will give you a start on getting some of that test code written.

    I will not discuss the basics of ATS because the sample scripts included with the Application Center Test provide a very good starting point for understanding the new load-testing methods.

    Let's try out some code to see if we can solve this old WAST problem. Start off by creating a connection to the Web server.

    
    sHTTPServer     = "localhost"
    Set oConnection = Session.CreateConnection(sHTTPServer)
    
    
    We need to check if the connection was created successfully. If not, we will write out an error to the log file using the Session.Trace method. (The log file is called ats.log and can be found in the ACT installation directory.)
    
    If (oConnection is Nothing) Then
          Session.Trace "Error: Unable to create connection."  & vbCrLF 
       Else     
    
    
    If the connection was made successfully, we can now send the request for the page that we need.
    
    ' set sPage to the name of the page you require. You can
          ' add additional folder names if you need. i.e. "/samples/ACTtest.asp"
    
          sPage = "/ACTtest.asp"
    
          Set oRequest = Session.CreateRequest     
          oRequest.Path = sPage 
    
          ' the request is sent
          Set oResponse = oConnection.Send(oRequest)
    
    
    You could write a piece of code to see if that request was successful or not, but the example scripts that come with ACT cover that perfectly. Provided that our request for the ACTtest.asp page went successfully, we can now get the returned HTML body of the request and try to retrieve our target variable (or customer registration ID).
    
    strBody = oResponse.Body
    
          iPos = InStr(strBody, "The random number is: ")
    
    
    The code snippet above stores the HTML body in a string; then we find the position in that string where the identification string starts. The identification string is a piece of text in the requested page that tells us that our target variable is going to be written next. Anything can be used as your identification string; it could even be a hidden form field. For this example I use "The random number is: " as my identification string.

    Once we know where our identification string starts, we can remove everything preceding that point (including the identification string itself, hence the "+ 21 )."

    
    strWaste = Left(strBody, iPos + 21)
          strBody = Replace(strBody, strWaste, "")
    
    
    Read in the next couple of digits from the remaining strBody, and we have our target variable.
    
    iRand = Left(strBody, 3)
          iRand = FormatNumber(iRand)
    
          Session.Trace iRand& vbCrLF 
    
          set oRequest = Nothing 
    
       End if
    
    
    I put in the FormatNumber out of practice and to ensure that we get a working integer to use. All that is left to do is write the target variable (stored in iRand) out to the log file, clear up some of the objects, and close off the If statement.

    If you were using this code snippet in your own test script, you would probably want to pass the target variable onto the next page in the sequence. I just sent it out to the log file to keep the code short.

    You should initially rely heavily on the log file to check how your script is working. Then just write the entire body of the returned page to the log file. You will probably need to increase the buffer size for the response if you want to write the whole thing into the log files because ACT only returns a set number of characters to the response object. Note that this must be inserted this before sending your request for the page. Use the ResponseBufferSize method to increase the size of your buffer. Here is an example:

    
    oRequest.Response.BufferSize = 50000
    
    
    Allotting 50,000 characters should cover the majority of your pages.ACT definitely takes a little time to understand than WAST, but it allows you to do so much more than its predecessor. It is well worth the effort to get those test scripts written in time for the full release, and then you can really give your site a hammering!

    Download complete source code for this article

    About the Author

    Brian Quinn works as an IT implementer for an Irish-based gambling company. Specializing in Windows 2000 and Internet--related technologies including AppCenter 2000, he is currently developing a .NET infrastructure to support his company's latest on-line gaming offering. Brian can be reached at bquinn@iname.com.

  • Rate This Article
    Not HelpfulMost Helpful
    1 2 3 4 5
    Supporting Products/Tools
    XCache
    XCache combines dynamic content caching technology with content delivery network (CDN) support options, file compression and a whole lot of manageability features to help e-businesses deliver superior web site performance and reliability. You'll appreciate the administrative ease, your visitors will appreciate increased page delivery speed.
    [Top]
    XCache
    XCache combines dynamic content caching technology with content delivery network (CDN) support options, file compression and a whole lot of manageability features to help e-businesses deliver superior web site performance and reliability. You'll appreciate the administrative ease, your visitors will appreciate increased page delivery speed.
    [Top]
    XCompress
    XCompress works by compressing outgoing text between the Web server and the client. Page response times may improve by a factor of three or more while overall bandwidth use can drop by two thirds or more.

    XCompress runs on Windows 2000 and Windows NT 4.0 and is tightly integrated with Microsoft Internet Information Server (IIS) with MMC and COM interfaces.

    [Top]
    XCompress
    XCompress works by compressing outgoing text between the Web server and the client. Page response times may improve by a factor of three or more while overall bandwidth use can drop by two thirds or more.

    XCompress runs on Windows 2000 and Windows NT 4.0 and is tightly integrated with Microsoft Internet Information Server (IIS) with MMC and COM interfaces.

    [Top]
    XTune
    XTune 2.0 is the most powerful tuning application for IIS 4 or IIS 5 ever conceived. Indispensable to the enterprise and straightforward, this web tuning tool allows you to configure hidden operating system, network, Active Server Pages and Internet Information Server settings for better performance, without any additional hardware or software.

    This version scans your system more deeply, offering more performance-enhancing recommendations and greater insight into your web architecture. The Performance Wizard guides and teaches you throughout the complete tuning process, so you can learn while making your box run better than ever.

    Purchase here.

    [Top]
    XTune
    XTune 2.0 is the most powerful tuning application for IIS 4 or IIS 5 ever conceived. Indispensable to the enterprise and straightforward, this web tuning tool allows you to configure hidden operating system, network, Active Server Pages and Internet Information Server settings for better performance, without any additional hardware or software.

    This version scans your system more deeply, offering more performance-enhancing recommendations and greater insight into your web architecture. The Performance Wizard guides and teaches you throughout the complete tuning process, so you can learn while making your box run better than ever.

    Purchase here.

    [Top]
    Other Articles
    Aug 25, 2005 - Performance Monitoring in SharePoint Portal Server 2003
    Performance monitoring helps organizations identify performance bottlenecks. The problem is that with so many performance numbers available, how do you know which ones to watch? This article helps you identify which are the critical performance counters in a SharePoint Portal Server environment and explains how to monitor them. By monitoring performance regularly, organizations can recognize performance trends as they develop and prevent problems before they get out of hand.
    [Read This Article]  [Top]
    Aug 12, 2004 - Middle-Tier Hosting: Enterprise Services, IIS, DCOM, Web Services, and Remoting
    There is broad-reaching debate about remoting, Web services, Enterprise Services, and DCOM. In short, it is a debate about the best technology to use when implementing client/server communication in .NET. Rocky Lhotka shares his thoughts on the issue while offering clear explanations of basic application architecture terminology.
    [Read This Article]  [Top]
    May 18, 2004 - ASP.NET 2.0 Caching Features
    This article examines some of the new and exciting caching features in ASP.NET 2.0 and shows how to implement them in Web applications.
    [Read This Article]  [Top]
    Feb 12, 2004 - Case Study: Match.com
    When it came time to find a technology for its massive upgrade, Match.com chose .NET. Has the online dating service's partnership with Microsoft been as successful as the relationships it has established for many of its millions of members? Read on ...
    [Read This Article]  [Top]
    Jan 15, 2004 - Database Performance Philosophy
    Longtime 15Seconds discussion list member Tore Bostrup offers valuable advice on designing databases and applications for efficient querying.
    [Read This Article]  [Top]
    Dec 29, 2003 - Caching Oracle Data for ASP.NET Applications
    Narayan Veeramani shows how ASP.NET developers can improve application performance by caching data stored in an Oracle database and keeping the cached data in sync with the data in the Oracle database.
    [Read This Article]  [Top]
    Dec 2, 2003 - Leveraging MSMQ in ASP.NET Applications
    Ever developed a Web application that requires extensive processing? Ever had long running Web pages that often time out in the browser? Greg Huber reveals a simple technique that uses Microsoft Message Queuing (MSMQ) and the System.Messaging framework to handle long running Web processes.
    [Read This Article]  [Top]
    Mar 14, 2002 - Web Site Compression
    As IT professionals try to reduce the cost of operating their Web sites, they should consider reducing the amount of bandwidth usage. Learn how to successfully compress your HTML output and save money on your monthly bandwidth.
    [Read This Article]  [Top]
    Feb 6, 2002 - The Just Two Theory on Web Servers
    Maintaining a large Web farm is both costly and unnecessary. Learn how to reduce your Web farm to just two servers in this controversial article by Wayne Berry.
    [Read This Article]  [Top]
    Aug 14, 2001 - NT Authentication's Impact on Connection Pooling
    Steve Witkop examines OLE DB and ODBC connection pooling when used with Microsoft NT LAN Manager Web server authentication.
    [Read This Article]  [Top]
    Mailing List
    Want to receive email when the next article is published? Just Click Here to sign up.

    Support the Active Server Industry



    JupiterOnlineMedia

    internet.comearthweb.comDevx.commediabistro.comGraphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info


    Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

    Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers