DCSIMG
Increase Web Test Reponses Size - Shai Raiten

Shai Raiten

 Subscribe

Increase Web Test Reponses Size

Increase Web Test Reponses Size

I just visit a customer that has a problem doing Web Test on his Web Application, the problem were that the response was cut off before web test was able to receive all the data, when he looked at the response he saw the data from the server but no all the data came back.
The response is almost 5mb and for some reason Web Test is unable to save all the data… Why?

The reason is VS has a receive buffer that defaults to 1,500,000 bytes (1.5 megabytes) and it throws away anything over that.
The number reported is what is saved in the buffer, not the number of bytes received.

In order to solve this issue you can just create a WebTestPlugin that will override  ResponseBodyCaptureLimit size limit. The code for that Plugin is super simple =

public class ResponseBodyCaptureLimitPlugin : WebTestPlugin
{
    public int ResponseSizeLimit { get; set; }
    public override void PreWebTest(object sender, PreWebTestEventArgs e)
    {
        e.WebTest.ResponseBodyCaptureLimit = this.ResponseSizeLimit;
    }
}

The only thing you need to change is before the Web Test starts is the ResponseBodyCaptureLimit value.

image

And Another tip if you want to use those Web Test scripts in Load Test you should define “Record Details” to False

Record Details – True indicates that performance counts data is collected for this HTTP request when the Web Test is added to the test mix of a load test. False indicates that data is not collected.

image

Enjoy

Comments

February 11, 2011 – VS/TFS Links and Quick Hits | Learn TFS said:

Pingback from  February 11, 2011 – VS/TFS Links and Quick Hits | Learn TFS

# February 11, 2011 3:04 PM

Shai Raiten said:

WebTestPlugins - Why? and How In my last post I’ve talked about Increase Web Test Reponses Size using

# February 13, 2011 11:41 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: