Bill Barnett's blog

Visual Studio Team System - Web and Load Testing

Simulation of browser caching in VSTS load tests and Web tests

In a VSTS load test that contains Web tests, the load test attempts to simulate the caching behavior of the browser.    Here are some notes on how that is done:

 

·         There is a property named on each request in a Web test named “Cache Control” in the Web test editor (and named “Cache” on the WebTestRequest object in the API used by coded Web tests).

·         When the Cache Control property on a request in the Web test is false, the request is always issued.

·         When the Cache Control property is true, the VSTS load test runtime code attempts to emulate the Internet Explorer caching behavior (with the “Automatically” setting). 

(This includes reading and following the HTTP cache control directives.)

 

·         The Cache Control property is automatically set to true for all dependent requests (typically for images, style sheets, etc embedded on the page).

·         In a load test, the browser caching behavior is simulated separately for each user running in the load test.

·         When a virtual user in a load test completes a Web test and a new Web test session is started to keep the user load at the same level, sometimes the load test starts simulates a “new user” with a clean cache, and sometimes the load test simulates a return user that has items cached from a previous session.    This is determined by the “Percentage of New Users” property on the Scenario in the load test.    The default for “Percentage of New Users” is 100 in which case all user sessions are started with a clean cache.    This is probably not correct for most applications where there are return users, so users should consider the most appropriate value to use for this setting depending on the actual usage of the application being load tested.

 

Important Note: When running a Web test by itself (outside of the load test), the Cache Control property is automatically set to false for all dependent requests so they are always fetched; this is so that they can be displayed in the browser pane of the Web test results viewer without broken images.

 

Update for VSTS 2008: The Web test API enhancement in VSTS 2008 now allow you to write a WebTestPlugin that disables caching of all dependent requests.    See this blog post: http://blogs.msdn.com/billbar/archive/2008/06/06/disabling-caching-of-all-dependent-requests.aspx.

 

 

Published Monday, January 22, 2007 8:07 PM by billbar@microsoft.com
Filed under: , , ,

Comments

 

Team System News said:

Noah Coad on Real TFS Command Line Help. The Visual Studio Team System User Education blog on Why...

January 25, 2007 8:58 AM
 

iiqbal said:

Hi

I am learning visual studio for tester, I am having one query

Please clear my point

Scenario I want to test

Objective =Load testing of hotmail

Steps to execute this scenario

Open the hotmail page

Enter the user name and password

Click on new link

Enter the email in “To” field say test@test.com

Click on send button

Application submit the mail and  Sign-out from hotmail

Record the above scenario in Visual studio test editions

Vs Test editions record and play the above scenario with out any error

Problem

But it doesn’t send mail in testing environment or in Visual studio browser or when I play this record web test

Issue

What is reason of this, if Visual studio for tester is not supporting these kinds of things, how we can test application in real environment

Suppose we provide the 100 of user email and password with the help of data binding at login page, but application is not sending mail what is the benefit of this tool

I am very confuse, please tell me solutions

Thanks in advance

March 22, 2007 10:41 AM
 

Ed Glas's blog on VSTS load testing said:

Visual Studio Team System for Testers Content Index for Web Tests and Load Tests Getting Started Online

December 19, 2007 4:08 PM
 

Bill Barnett's blog said:

June 6, 2008 4:00 PM
 

dbarel said:

Hello,

I am running a load test using a rig that includes the following:

3 agent

3 server application (that are under load balancer\alteon)

1 machine VSTS 2008 (and where my code is)

I am running a load test that includes fetching images from an outside machine.

as you know this images are gathered by sending following requests (requests that i didn't write a code for it ) to a server and fetching it.

The problem is that certain images that are sent are causing my tests to fail.

Is there any way that i can exclude some of the requests that are send (images) by invoking an event handler??

Thanks,

Daniel

December 29, 2008 11:37 AM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker