Enhanced web test support in Fiddler

If you have ever had trouble recording a web site with the web recorder included in VSTS, then we have probably suggested recording the same site with fiddler and looking for requests that the VSTS recorder did not capture. If you are not familiar with Fiddler, here is a short description from the fiddler site, “Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and "fiddle" with incoming or outgoing data.” The author of fiddler included the ability to save a fiddler recording session to a VSTS .webtest file. Although the file saved was a valid web test, there were a few problems.

1. The saved test included all dependent requests such as images, css file, js files, etc.

2. It included requests that were the results of a redirect.

3. The test did not correlate any hidden fields for you. i.e. viewstate

So although you could save a test, it was not saved the same way the VSTS recorder would save it.

I have been working with the owner of Fiddler to add enhanced web test support and he just recently released the updated version of fiddler to the web. You can get the updated version at https://www.fiddler2.com/fiddler2/. Here is a list of the new features:

· Ability to filter out dependent requests

· Only first request in a redirect chain will be saved.

· Automatic correlation of view state and event validation fields

· Plug-in architecture that allows you to write your own custom code that can change how a web test is saved.

I will discuss the last point in detail in a later post. I will walk through the other changes below.

First I am going to launch fiddler and check to make sure that the version of fiddler is 2.0.8.8 or later. You can do this by going to Help -> About Fiddler. After launching fiddler I am going to launch IE and record a simple web test. The web test will include a script against the IBuySpy web site, which is a sample shopping cart application. I will add an item to the cart and then complete the purchase. This set of steps includes 6 different top level requests. Here is a screen shot from fiddler after recording the script:

As you can see there are many more than the 6 top level requests. Now I am going to save this test with the old version of fiddler to show you what the resulting web test looks like. See the below screen shot. As you can see each of the requests that existed in the fiddler UI are now in the web test. You would need to modify this web test prior to using it, by deleting the dependents and correlating hidden fields.

Now let’s walk through the new method of saving the test. Select all requests in the fiddler UI and then go to File - > Save -> Sessions -> as Visual Studio Web Test. First you will be prompted for where you want to save the test.

 Next you will be prompted for which FiddlerWebTestPlugins you want to execute. This dialog will look like it the screen shot below:

A FiddlerWebTestPlugin is a class that has access to the fiddler sessions and can modify how the web test is saved. If you are familiar with VSTS web test plugins, these are implemented in a similar manner. I will go into much more detail about the plugins in my next blog post. For now accept all the available plugins and click OK. When you do, the resulting web test will look like the following:

As you can see there are only 6 requests in my web test. Now look at the viewstate parameters. You can see from the screen shot below, that they are automatically correlated for you.

This web test is ready for use without any modifications. Now it should be much easier to record and save a web test using fiddler.

Comments

  • Anonymous
    April 17, 2007
    The following article discusses enhancements made to fiddler which make it easier to use fiddler for

  • Anonymous
    April 17, 2007
    I read with interest this morning, Sean Lumley's blog post entitled " Enhanced web test support in Fiddler

  • Anonymous
    April 18, 2007
    Sean Lumley , a developer on the VSTS web test team, has written a series of posts on using a new version

  • Anonymous
    April 18, 2007
    Je vous avais parlé de Fiddler et de l'article écrit par Florent Santin à ce sujet dans un post précédent

  • Anonymous
    April 19, 2007
    沒聽過 fiddler ? 你也應該試試下載 Fiddler2 HTTP Debugger - Fiddler2 Sean Lumley's Blog 整理了一份很詳細的文件, 你可以用 Fiddler

  • Anonymous
    April 19, 2007
    Great one! Nice to see that Fiddler 2 solved those key probs during my usage of Fiddler 1.x for generating .webtest.

  • Anonymous
    April 23, 2007
    The Blog entries are going to be few and far between for a few days as I am finishing content for my

  • Anonymous
    July 08, 2007
    Je vous avais parlé de Fiddler et de l'article écrit par Florent Santin à ce sujet dans un post précédent

  • Anonymous
    July 08, 2007
    Je vous avais parlé de Fiddler et de l'article écrit par Florent Santin à ce sujet dans un post précédent

  • Anonymous
    May 04, 2009
    One of the best features of Fiddler when performance testing is it’s ability to save a capture as a Visual

  • Anonymous
    August 04, 2010
    I work as a non-functional test contractor and have been using HP LoadRunner for most of my work. When I come across VSTS I literally fall in love with that tool. Apart of its more appalling GUI it adapts very good approach to performance testing with extraction rules and other plug-ins. Now if you add Fiddler you have a fantastic solution with Fiddler acting as a recording and VSTS acting as a replay engine. Here is my blog explaining how to use both together to record a WebTest: maciejzaleski.blogspot.com/.../using-fiddler-with-visual-studio-team.html

  • Anonymous
    March 21, 2013
    I noticed that in fiddler version 2.4.2.6, the dependent requests are not placed under the primary request on the exported webtest file anymore.  Is there a reason for this and how can i do this?  I tried creating a fiddler webtest plugin but the existing VSWebTestExport does not even write out DependentRequests node.

  • Anonymous
    April 26, 2013
    Hi friends while generating my webtest I am receiving an error pop up stating "Failed to save test. startIndex Cannot be larger than length of string" can anyone suggest some troubleshooting