Load Tests with Visual Studio

Load Tests:-

Hi Friends,

In the last section i have briefed about web tests. Now, one important piece I would like to demonstrate here is load test. So, basically a load test is a combination of Unit Test and Web Performance Test. So, as I said load test is going to simulate your application with lots of virtual users @ the same time. So, when you run the load test, some of the most crucial parts to look for are performance counters like perfmon, user statistics and many more things on the server. So, let’s go ahead and add load test in our application. So, we will do right-click on Web Test project and do the following things as shown below in the screen shot



Now, click on next button. This will open a new page where in you can go ahead and set variety of test counters as shown below.


Now, as you can see in the left panel there is variety of test patterns or counters which you can set to test different scenarios. Currently for demo purpose I am good with default settings, till the point I reach the point Test Mix as shown below in the screen shot.


Now, here I need to add test cases by clicking on Add button as shown below in the screen shot.


Now, here you need to select the test cases which you are interested in by clicking the arrow button.


Then I’ll click ok and I’ll just click on next button till the time I reach “Counter Sets”. Now, in Counter sets I would like to set couple of things like shown below


Now, here I have done couple of things, 1st by clicking on Add Computer button I added two nodes, 1st node I have named as “Webserver” and added all the server side counters in that, then again I clicked on Add Computer and given the name “Database” Server and then added Sql settings in that. If you notice in the above screen shot, I have also given tag names to both the computers as it would be helpful to analyze when test is running. Now, in the next page I will set Run Settings as shown below


So, here I have set the test duration for 1 minute. So, this test will run for 1 minute and capture all the data. Other things like Save the log even if test fails is set to true, that’s by default. Also I am keeping Validation rules High, as this is my 1st test so I want all the scenarios should get covered. So, now I am going to click on Finish. Once, I click on Finish button, it will generate the Load test for me with all the scenarios and counters which I have set in the wizard as shown below.


Now, when I check certain properties like load pattern property, you will notice that default value is set, and that is set for “25 users” which we have chosen from the wizard.


So, now we have everything in place, I’ll just go ahead and click the button on the top left and then it will produce the below result.


Now, when you click on Graphs, it will display the how specific test scenarios behaved.


You can also analyze the snapshot of the test counters which you have added like shown below


Like this there are many more things which you will find interesting while reading the up coming book “Hands-On With ASP.NET MVC”, a complete guide to build an end to end application right from the scratch. Till then stay tuned and Happy Coding.

Happy Coding

One thought on “Load Tests with Visual Studio

Comments are closed.