When playing back a recorded web test with Microsoft Visual Studio Team System 2008 Test Edition SP1 the web test fails due the size of the Response
Scenario: You have a recorded a web test using Microsoft Visual Studio Team System 2008 Test Edition SP1. When you play back the web test it fails. The actual error message might vary.
Reason: By default Microsoft Visual Studio Team System 2008 Test Edition SP1 captures the first 1.5 MB of the response; as a result the response is truncated.
Solution 1:
- Create a coded Web test by converting a recorded Web test
- Add the following code to the constructor - this.ResponseBodyCaptureLimit = 3500000;
Solution 2:
- Create a Web Test Plug-In
- Sample code for the plug-in
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.WebTesting;
namespace PluginSample
{
public class Class1 : WebTestPlugin
{
public override void PreWebTest(object sender, PreWebTestEventArgs e)
{
e.WebTest.ResponseBodyCaptureLimit = 2000000;
}
}
}
To add the Web test plug-in, click Set Web Test Plug-in on the toolbar. This displays your test plug-in in the Set Web Test Plug-in dialog box. Select your class and then click OK.
Comments
Anonymous
June 08, 2010
This is very useful. It solved my problem. I am supprised to see the point not clearly documented out in web performance test. Anyway, big thanks.Anonymous
June 13, 2010
I am glad to hear that the blog helped you solve your problem.Anonymous
July 03, 2014
very useful solve my problem tooAnonymous
March 06, 2015
I can report that Visual Studio 2013 still has this issue and your fix solved it. I've had the problem for years where randomly it appears that ExtractHiddenFields is failing. Turns out all along it was simply a problem of the response being truncated. Why, why, why, Microsoft, did you not make this obvious!