VSTS 2008, Web Tests and using Fiddler

Published Tuesday, June 3, 2008 5:04 PM

I have been doing some performance and load testing of a web application I have been working on lately. Most of my previous experience was with the 2005 flavour of VSTS and I was keen to play with the 2008 version to see what improvements have been made. This web application is quite heavy in terms of Javascript and AJAX feature usage.

I am happy to report that things are much better in this version, but still not as easy as I had hoped. Form value extraction and recognition of AJAX requests seem to work well.

However, I still had some problems running the tests. For the most part they would run ok, but would cause errors on the server such as:

'Index was outside the bounds of the array.' at System.Web.Handlers.ScriptResourceHandler.ProcessRequest

which was always when accessing some script resource via the ScriptResource.axd handler.

I could see no reference to any of my code in there. Everything seemed to work as far as the client aspect was concerned (examining the results of the web tests) but this did not sit too well with me.

So I decided to try and record some tests via Fiddler2 HTTP proxy tool to see if that helped. There was definitely a little more work in getting this to record and playback web tests properly, but I was able to get some cleaner looking tests, and no errors generated on the server using this method. I did verify that all the functionality was being exercised on the server just in case I was missing anything and getting false positives.

The procedure I used to record web tests and get them working was.

  • Load Fiddler2
  • Load Internet Explorer and browse to the site, running through my specific performance test scenario.
  • In Fiddler, press F12 to ensure no more sessions/traffic is captured.
  • Select all the sessions by using CTRL-A (ensuing there was no other traffic that got recorded at the time. If there was, just highlight that session and delete it)
  • Go to the File >> Save >> Sessions >> As Visual Studio Web Test menu optionimage
  • In Visual Studio 2008, within your test project, add in the existing web test.
  • VS2008 will add some 'Form Field' extraction rules to each request.

image

  • If you are using UpdatePanel's a lot and need to extract the ViewState from UpdatePanel delta responses, you will need to change the extraction rule.
  • For this I created a Text Extraction rule.

image

  • This rule simply looks for __VIEWSTATE| (yes, that's a pipe char on the end) as the start text and a pipe | as the end delimiter text and extracts everything in between.

image

  • I had to add this extraction rule to each request, and replace the references to the old Form field extraction value

image

  • with references to our new AJAX text extraction rule.

image

Like I said, it was a little bit of work to go through each page request and fix it in this manner, but the tests execute cleanly every time with no errors on the server as previously mentioned and it is actually a neater looking web test.

Comments

# glupwillie said on Tuesday, June 3, 2008 4:23 AM

Never heard of fiddler, interesting :-)

# hartertobak said on Wednesday, June 11, 2008 7:08 AM

Fiddler is nice for IE, for firefox I think there are plenty of extensions, that do Fiddlers job, too

# Glav said on Wednesday, June 11, 2008 6:33 PM

Yep, there are some excellent tools for firefox, but in this instance, Fiddler has direct support for saving Visual Studio Web Tests. I dont know of any firefox related tool that does that.

# mr tester said on Tuesday, July 1, 2008 10:55 AM

You can use fiddler with Firefox.  Simply set firefox to use a proxy connection with the same port that fiddler is running on - 127.0.0.1 and port 8080 I believe.

Leave a Comment

(required) 
(required) 
(optional)
(required) 

This Blog

Syndication