Posts Tagged visual studio

Testing Ajax Web Application

Recording and Running the Webtest in Visual Studio seems easy now..(You can see creating the webtest in my previous posts).
It’s well and good if webtest doesn’t fail but what if webtest fails????
There are many reasons why the webtest fails but the most common one (or  i can say which i encountered frequently) is webtest containing the ajax controls or postback functionality fails.

The Reason being is that the Web test engine works at the HTTP layer, it does not directly simulate client-side scripting like JavaScript or ActiveX controls. Web tests are concerned with generating load on a server. As a result, client-side scripting that only affects the appearance of a Web page is not significant to the Web test. Client-side scripting that sets parameter values or results in additional HTTP requests (such as AJAX) does affect the load on the server and might require you to manually modify the Web test to simulate the scripting.
That means we need to modify some of the parameters in the webtest to make it to run properly.

How do We Do it??? Here goes the solution and it did work for me….

So i wanted to share this with u all hoping that it may help you. 🙂

So,Just open the window consisting of webtest in Visual Studio,expand the links(involving ajax) and there you can find the folder named Extraction Rules which has Extract Hidden Fields option.(This is where the problem lies).
If u r using Visual Studio 2008 Right Click and select Properties as shown below.


This Opens up a Properties window.In that Required field would be true by default.Change this Value to false.



Do this for all the Hidden files present in the web test.
But it’s the different case when  u r using vs 2005 as there is no Required option then just right click the Extract Hidden Files option and Delete the Extract Hidden Fields as shown.



That’s it! u r Done!!!! Now just Rerun the webtest after saving the changes made.Now your  Webtest should run properly without any errors.

Also we can use “Fiddler” tool  for this kind of webtests.Go through these links to know more about “Fiddler”.

Hope this is useful!!!

Comments are most welcome 🙂


Comments (3)

Creating a WebTest

Last few days I was working on Load testing and in that process i came across creating a WebTest to continue with the Load Testing.

I thought I would blog on this, so that it might help the beginners in creating the  Web Test easily. Here goes the step by step procedure of creating the webtest.

(i)First Step is Creating A New Test Project.
Open Visual Studio,Go To File->New->Project,Then a New Project Dialog Box Opens.
There Expand the Visual c# node and select Test,accept the default name TestProject1 and then click OK.


(ii)Now having successfully created our testproject we will proceed with creating a web test.

Steps for creating the Web Test.

(1) In Solution Explorer,right click the TestProject1,Select Add and then Select Web Test.


(2)Web test gets added up under the Test Project and A browser Window Pops Up as shown below where u can enter the Url for which you want to run the web test.


(3)In the Address Bar replace the about:blank with the url and press the Enter Key on the Keyboard.

(4)Now the user inputs are recorded and they are stored in the web test which u can playback later.After U added all the data that u want to test Click “Stop” button to Stop recording and return to the project.

(5)That’s It your webtest now contains a list of recorded actions as shown below.


Now having recorded the webtest next step is to run (playback) the test.

–>VS 2005 provides a Run button in the toolbar(first button with a green arrow) for this purpose.


–>Clicking on the Run Test will replay the test and the Test Results window will show whether or not the test was successful.If You cannot see the Test Results window,on the Test menu,select Windows,and then select Test Results.


That’s it guys!!!!

You are done with creating the webtest successfully.After creating this webtest you can proceed with the load test or what so ever.

Hope it helps!!!!!:) 🙂

Happy Testing 🙂

Ur Comments are valuable.

Leave a Comment