When you are testing a web application and the test keeps failing, it can be very frustrating. The fix is simple yet complex at the same time. First you should understand why the failure is occurring. The request that appears to be failing is not always the problem. There may be a previous request that is not behaving the same way it did during the initial recording. Dynamic variables, like the session id, of which is hard coded through the requests you make and you will have to modify your requests to not hard code the values.
To debug these interference, you will need to look at the request that is failing and determine which one the error is. There are two that you will commonly see.
The first you should look at is automatic hidden field binding failure. When this happens you will see: “RequestFailed: Context parameter ‘$HIDDEN1.__VIEWSTATE’ not found in test context”. This message is indicating that the web test tried to extract a hidden field called VIEWSTATE from the previous response but was not able to extract it. There are two ways to fix this.
You can visually compare the playback results and make your determination from there of which is very time consuming. The other is the use of a tool called fiddler. This is a proxy recorder and will capture requests, responses, and headers during each recording. You can use this to compare with what the VS web test engine and see what it is submitting, and you will be able to determine if they match. This might be a little overwhelming at first, but once you understand the basics of testing and monitoring web applications, other aspects of the field should begin to make sense.
You should note that this is what has worked for others in these situations and may not fix the problem every time. There are other tools available that will be able to aid you in figuring out what the problem is with your web application. These tools can be found through web engine search.