Getting Started with Load Testing in Visual Studio 2012

Getting Started with Load Testing in Visual Studio 2012

  • Comments 7

Since the release of the Visual Studio 11 Beta I have had several questions about load testing in Visual Studio.  All of the questions to date have been around getting started…

Unlike Visual Studio 2010 that had Test > New Test > Load Test on the menu you have to create a new project of one of the three Test projects. 

 

image

 

While there is a project type called “Web Performance and Load Test Project” it doesn’t create a Load Test by default. …Which is okay as a load test without any tests to supply load to doesn’t make a lot of sense.

image

Fortunately adding and creating a load test is trivial….

image

There is also some confusion about running the Load Test as the new Test Explorer doesn’t show Web or Load Tests and the Green “Run” button for the solution is trying to run the output that being created from the solution…Which in this case is  something like: WebAndLoadTestProject1.dll.

I did speak with Peter Provost (The owner of the of the Test Explorer) and it makes total sense to me why Web and Load tests do not show up by default in the Test Explorer as his primary scenario is enabling developers do “Red, Green, Refactor” sort of workflows.  He also realizes having CodedUI Tests showing up is a little off script -and rest assured he wants to be to able service different workflows too.

image

We aren’t quite done yet though; as running the Load Test at this point generates the error:

Could not connect to toad lest results database.
1 If SQL Sever is not installed on the local machine you can download and
install SQL Server Express from here
2. Check that the Load Test results database specified by the connection string is
currently available and valid.
 

forchuck

 

Fortunately this is quite easy to fix….Navigate to the IDE directory were you installed Visual Studio 2012 and open the file: loadtestresultsrepository.sql.

Right clicking anywhere in this file and choosing “Execute” will prompt you for the location of the SQL Server you want to store the results.

NOTE if you are installing the database using SQL Integrated Security you will want to run Visual Studio as an Administrator.

 

image

 

At this point your load Tests should be ready to run.

(in this case since I am just running against Microsoft.com the performance counters for System under Test should be empty).

image

 

For more information on running and configuring Load Tests with Visual Studio 2012 please see:

Testing Application Performance and Stress

Leave a Comment
  • Please add 7 and 8 and type the answer here:
  • Post
  • Hi Charles

    Thanks for the article!

    I have one question: In my new installation of Visual Studio Premium 2012, I only have two project templates: Coded UI Test Project and Unit Test Project. Web Performance and Load Test Proeject is missing.

    Can I download this somewhere?

    Regards

    Jakob Rohde

  • Hi,

    Thanks for the Article.

    @Jakob, You 'll get Web and loadtest only with Visual studio Ultimate 2012.

    Regards,

    Abraham

  • Hello Jakob,

    Load testing is an Ultimate only feature

    Thanks

    Chuck

  • Hi All,

    We are migrating from VSTS 2010 to VSTS 2012. Can you please clarify following doubts:

    1. With Trial Version of VSTS 2012 ultimate version how many Vusers we can initiat like i Have 5 Agents and i controller

    2. Can VSTS2010 works on XP

    3. Do we need to buy any Virtaul user pack for VSTS 2010 ultimate version too.

    Early Respose is appriciated. Please help.

    Thanks,

    Naveen

  • Charles, hi.

    Please tell me if there is a way to record WebServices load tests the same manner.

    Could I arm recording, then perform some actions against my WebService, for example by accessing it with Client application, and then get all request that were done like it is possible with web-site in your example?

    Basically - same like jMeter (when they use small proxy server to catch all internet activity)

  • I have VSTS premium 2012.I am not having web performance & load test project. can any one help me how to  update it.

  • Hi. Why many futures removed from vs2012? It is getting worse, isn't it?

Page 1 of 1 (7 items)