{"id":4973,"date":"2012-06-04T12:41:28","date_gmt":"2012-06-04T12:41:28","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2012\/06\/04\/getting-started-with-load-testing-in-visual-studio-2012\/"},"modified":"2019-02-14T17:59:22","modified_gmt":"2019-02-15T01:59:22","slug":"getting-started-with-load-testing-in-visual-studio-2012","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/getting-started-with-load-testing-in-visual-studio-2012\/","title":{"rendered":"Getting Started with Load Testing in Visual Studio 2012"},"content":{"rendered":"<p>Since the release of the Visual Studio 11 Beta I have had several questions about load testing in Visual Studio.&nbsp; All of the questions to date have been around getting started\u2026<\/p>\n<p>Unlike Visual Studio 2010 that had <strong>Test<\/strong> &gt; <strong>New Test &gt; Load Test<\/strong> on the menu you have to create a new project of one of the three Test projects.&nbsp; <\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/3007.image_597E57AF.png\"><img decoding=\"async\" title=\"image\" style=\"border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/6644.image_thumb_19483E35.png\" width=\"349\" height=\"235\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>While there is a project type called \u201cWeb Performance and Load Test Project\u201d it doesn\u2019t create a Load Test by default. \u2026Which is okay as a load test without any tests to supply load to doesn\u2019t make a lot of sense. <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/2018.image_40165475.png\"><img decoding=\"async\" title=\"image\" style=\"border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/1351.image_thumb_4AD3ABCA.png\" width=\"356\" height=\"234\"><\/a><\/p>\n<p>Fortunately adding and creating a load test is trivial\u2026.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/7612.image_1F8F14C3.png\"><img decoding=\"async\" title=\"image\" style=\"border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/8272.image_thumb_465D2B03.png\" width=\"353\" height=\"216\"><\/a><\/p>\n<p>There is also some confusion about running the Load Test as the new Test Explorer doesn\u2019t show Web or Load Tests and the Green \u201cRun\u201d button for the solution is trying to run the output that being created from the solution\u2026Which in this case is&nbsp; something like: <strong><em>WebAndLoadTestProject1.dll.<\/em><\/strong> <\/p>\n<p>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 \u201cRed, Green, Refactor\u201d sort of workflows.&nbsp; 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. <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/8765.image_3F3DEE8B.png\"><img decoding=\"async\" title=\"image\" style=\"border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/7282.image_thumb_45F0F80E.png\" width=\"357\" height=\"178\"><\/a><\/p>\n<p>We aren\u2019t quite done yet though; as running the Load Test at this point generates the error: <\/p>\n<blockquote>\n<pre>\nCould not connect to toad lest results database.<br>\n1 If SQL Sever is not installed on the local machine you can download and<br>\ninstall SQL Server Express from here <br>\n2. Check that the Load Test results database specified by the connection string is<br>\ncurrently available and valid. <\/pre>\n<\/blockquote>\n<pre>&nbsp;<\/pre>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/1030.forchuck_05BADE94.png\"><img decoding=\"async\" title=\"forchuck\" style=\"border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px\" border=\"0\" alt=\"forchuck\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/4666.forchuck_thumb_69AA1FA8.png\" width=\"358\" height=\"184\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Fortunately this is quite easy to fix\u2026.Navigate to the IDE directory were you installed Visual Studio 2012 and open the file: loadtestresultsrepository.sql. <\/p>\n<p>Right clicking anywhere in this file and choosing \u201cExecute\u201d will prompt you for the location of the SQL Server you want to store the results. <\/p>\n<p>NOTE if you are installing the database using SQL Integrated Security you will want to run Visual Studio as an Administrator. <\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/7612.image_107835E9.png\"><img decoding=\"async\" title=\"image\" style=\"border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/1348.image_thumb_24FD8567.png\" width=\"370\" height=\"167\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>At this point your load Tests should be ready to run. <\/p>\n<p>(in this case since I am just running against Microsoft.com the performance counters for System under Test should be empty). <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/5164.image_08ECC67C.png\"><img decoding=\"async\" title=\"image\" style=\"border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/3581.image_thumb_047645B5.png\" width=\"370\" height=\"247\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>For more information on running and configuring Load Tests with Visual Studio 2012 please see: <\/p>\n<h2><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd293540(v=vs.110)\">Testing Application Performance and Stress<\/a><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Since the release of the Visual Studio 11 Beta I have had several questions about load testing in Visual Studio.&nbsp; All of the questions to date have been around getting started\u2026 Unlike Visual Studio 2010 that had Test &gt; New Test &gt; Load Test on the menu you have to create a new project of [&hellip;]<\/p>\n","protected":false},"author":81,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,252],"tags":[],"class_list":["post-4973","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-testing"],"acf":[],"blog_post_summary":"<p>Since the release of the Visual Studio 11 Beta I have had several questions about load testing in Visual Studio.&nbsp; All of the questions to date have been around getting started\u2026 Unlike Visual Studio 2010 that had Test &gt; New Test &gt; Load Test on the menu you have to create a new project of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/4973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=4973"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/4973\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=4973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=4973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=4973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}