Problem description:

Here I am describing some tips around troubleshooting webtest failure during playback of the recorded webtest scripts.

 

Resolution:

You may notice that you have recorded webtest for your application, however, it fails during playback immediately or after some time of the recording. In these kind of scenarios, you
may try below steps for debugging webtest failures:

 

  1. Record the webtest with fiddler tool and save it as webtest and play it back. In case it works, you are good, otherwise you have to do further debugging on the failure.

       2.  Play your webtest with visual studio, and at the same time, capture the traces with fiddler.

    Then see the difference between the requests in the webtest and fiddler traces. In case there is some missing requests or additional  requests in the fiddler, remove or add them accordingly in your webtest.

     In case, you notice that script is failing during playback with the session timeout error, most of time this error comes due to the dynamic parameter which has not been generated by webtest recorder properly.

     

    Here I'd like to describe some scenarios which I diagnosed recently:

                                        
    i. We created the script with visual studio and fiddler both, but it was failing after around 2 hours, after extensive debugging we found that there was a dynamic parameter in the response which was storing certificate information with session information which was getting expire after around 2 hours. By creating a extraction rule on that parameter and adding that to each of the subsequent requests, everything worked fine.

                                         
               ii.  In one webtest, it was failing immediately during playback, with the comparison of the webtest result with fiddler trace, we found that the referrer was missing in the requests in the   webtest. After adding the referrer in each of the requests, webtest worked fine. You can follow the below blog for adding registry to automatically add referrer in the request:

                 http://blogs.microsoft.co.il/blogs/shair/archive/2011/02/02/how-to-include-http-headers-in-web-test-recording.aspx

     

               Fiddler tool can be downloaded from here:

                http://www.fiddler2.com/fiddler2/version.asp

             Some debugging tips:

              http://msdn.microsoft.com/en-us/library/ms364082(v=vs.80).aspx

              http://blogs.msdn.com/b/slumley/archive/2007/04/10/how-to-debug-a-web-test.aspx

    Content developed by: Deepak Mittal 
    Content reviewed by: Teodora Stanev