I really want to take part in the Visual Studio 2010 contest. We have already written about
Unit testing , about
UI testing applications , so I will write about testing web applications. And since
ASP.NET MVC Framework 2 comes bundled with the new Visual Studio 2010, I’ll use it.
This is NOT a serious guide to UI testing, it’s just an easy reading matter that will enlighten even green studio lovers (like me) about an important and convenient, but slightly frightening feature.
Create a project "ASP.NET MVC Web Application 2". I envy those who work with this framework, while I myself just indulge and read the book of G. Magdanurov and V. Yunev, and therefore I will begin with this.

')
The studio itself proposes to create a unit test project, a trifle, but nice.

So, we already have a ready-made web application that can be launched and subjected to all kinds of experiments. To begin with, I recommend to do it manually, and then proceed further to creating a Web Site performance test:

You will see a great and terrible IE, with an additional test recording panel, which
you can open to the word without the help of the studio. You must enter in the address bar the path to our site, in my case it is "http: // localhost: 42258 /".

Each time you click on one of the links inside our website, the Web Test Recorder will record the path that the transition took, and the delay time before the transition (ThinkTime) - because the system will have to simulate a real user who “thinks” before following the link. In order to complete the test, you must click on Stop (I had a test recorder panel in English, apparently this is due to the English-language locale of Windows).
Similarly, we create several more benchmarks for website performance. In one of them, I specifically tried to log in to the site with an incorrect password in order to check the interaction with the login system and see what the failed tests look like.
Such testing is suitable for a quick test of the performance of the website. In my opinion, the translation of "Web Test ..." as "Test performance of the website ..." is not the best, because
performance is somewhat different from the simple ability to work But load testing will show how efficiently our site can operate in conditions that are even remotely close to reality.
Create a Load Test:

It is worth noting innovation at one of the stages of the wizard to create a test. Visual Studio 2010 introduces a new way to model a test suite - “Based on sequential order”. A similar item was not found by me in the 2008 studio, if I am mistaken, correct it.

At the “Test suite” stage, we will need previously created Site Health Tests. Because load testing involves the emulation of various ways to access the site, after the completion of the creation procedure, the system will offer to install the network emulation driver. After creating the test, we can always edit the given parameters.

By running the test, we will see the drawing of a whole set of graphs, the collection of not a small number of statistical indicators, the analysis of which at first glance seems to be quite a laborious task. It should be said that my experiments were conducted on a rather weak laptop, so if you noticed, the second picture clearly showed the peak of the red graph, at this very moment I saved a screenshot, which affected the performance of the web application.


Of course, in real-world server conditions, it is necessary to test the load from a variety of physical machines, but for the initial “home” testing, the built-in Visual Studio tools are more than enough.