MyTechFinds.com

  • Increase font size
  • Default font size
  • Decrease font size
Home Articles Software Testing Test Automation What are webtests in Visual Studio Team System

What are webtests in Visual Studio Team System

E-mail Print PDF
Visual Studio Team System 2008 offer variety of tests that you can create depending on the application and your testing needs. I recently came across a scenario where I want to test basic functionality of our home grown proxy server. The testing focus was to make sure that the server behaves as expected on the GET and POST requests send to it. I quickly figured out that I am going to need some tool with with I am able to record/capture HTTP request going to and coming from the server. OpenSTA was an obvious choice, as I knew I can do that in OpenSTA, but when you have a powerful tool like VSTS, you may want to think twice. Also, as all the other tests for the project were in VSTS umbrella, it made more sence to include these server tests to the same suite. VSTS offers a kind of test with which you can record/capture the HTTP/S traffic to your webserver or website or for that matter any such server that is communicating on HTTP protocol.

Basics of webtest :
Webtest is made of series of HTTP requests. When executed, you can see the respose coming from the server. Furthermore, you can use different extraction rules to grab hold of any information from the referer response that you may need to construct/pass in to the next request. (I know how painful parameterizing the script generated in OpenSTA, so I specially love this feature of extraction rules).

Recording a webtest :
First of all, you need to create a "Test Project" in visual studio.



Once you have the test project, you can create a test of type - webtest. To do that, right click on the project from the solution explorer and select webtest from add item menu as shown below,



As soon as you create the new webtest, VSTS will launch a default browser with a webtest recorder on the left side of the browser. All you have to do now is, browse the web application or website under test and perform the actions you want to include in your web test. These actions are usually a user scenario. After you complete recording the user scenario, hit stop on the recorder. This will stop the test recording and generate the required webtest view.



VSTS also tries to parameterize the URLs as much as it can before creating the webtest. You can see above that VSTS converts post parameters into required variables using "extraction rules". You can hit F5 at this point to run the recorded test case. If all the parameters are convered, you are pretty much done. Now you can create similar tests for other user scenarios and execute them against your web application or a web site.

What other things you can do with webtest -
  1. Web tests can also be used to test web services,
  2. You can specify GET or POST for each request,
  3. You can add "think time" to each request,
  4. You can parameterize the server part in the URL (this is helpful when you have multiple environments to test on),
  5. You can add "validation rules" to validate the result of each request and test as whole,
  6. You can add "data source" to the test to iterate it over large combinations of POST parameters,
Some advanced features of webtest - 
  1. Generating code - coded webtest - of recorded webtest, this can really expand the functionality of the webtest as you can add more logic to your user scenario, by adding loops, conditions etc.
  2. Add webtest plugin, again to add more functionality to the web test, I have usually seen it used to store and retrieve data from a database during webtest runs,
I will try to write some more on this topic to cover the list of things stated above, stay tuned,

( 1 Vote )
Comments
Search
Only registered users can write comments!

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Saturday, 15 August 2009 21:21  

Our valuable member Ajay Majgaonkar has been with us since Thursday, 23 April 2009.

Show Other Articles Of This Author

Software Testing

Login

Like it? Share it!


Search

Polls

Which of the following are characteristics of testable software?
 

MyTechFinds

Advertisement

Help us
We have 6 guests online