{"id":1323,"date":"2014-05-14T11:14:48","date_gmt":"2014-05-14T11:14:48","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2014\/05\/14\/binding-a-cloud-load-test-to-a-data-source\/"},"modified":"2022-07-15T04:18:02","modified_gmt":"2022-07-15T12:18:02","slug":"binding-a-cloud-load-test-to-a-data-source","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/binding-a-cloud-load-test-to-a-data-source\/","title":{"rendered":"Binding a Cloud Load Test to a data source"},"content":{"rendered":"<p>At StarEast I had a couple of Web Performance Tests in my demo solution that people asked about.\u00a0 Namely the Web Tests called:\u00a0<\/p>\n<ul>\n<li><strong>Perfecto_Mobile_IOS5S<\/strong> <\/li>\n<li><strong>SEO_Databound<\/strong> <\/li>\n<\/ul>\n<p>As the name suggests with the first Web Test is something I have been working with Perfecto Mobile on some of their new features and hope to have another post when they are ready to make an announcement \u2013 Sorry guys no spoilers just yet!<\/p>\n<p>The second Web Test is as the name suggests data bound to a search term list (in our session we looked at how our Search Engine Optimization was trending).\u00a0\u00a0<\/p>\n<p>While data binding a Web Test is not hard \u2013it is also not intuitive and taking it to a Cloud Test has some caveats I thought I would walk through.<\/p>\n<p>\u00a0<\/p>\n<p><strong>Step 1. Creating a Web Performance and Load Test<\/strong><\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/0523.image_thumb_33512B12.png\" width=\"560\" height=\"389\" \/><\/p>\n<p>This is as easy as File>New Project>Web Performance Test in Visual Studio Ultimate.\u00a0\u00a0 (Yes this is ONLY available in Visual Studio Ultimate \u2013 but we make this freely available as a trial here: <a href=\"http:\/\/www.visualstudio.com\">http:\/\/www.visualstudio.com<\/a> )<\/p>\n<p><strong>Step 2. Create a Web Test Recording<\/strong><\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/8473.image_thumb_7C0AA3D6.png\" width=\"696\" height=\"405\" \/><\/p>\n<p>In this example ALL I did was open Bing and searched for the term \u201cPhone Frogger\u201d<\/p>\n<p><strong>Step 3. Clean up the Web Test Recording<\/strong><\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/7737.image_thumb_64DF2958.png\" width=\"570\" height=\"490\" \/><\/p>\n<p>As I indicated above i ended up with all this traffic by recording the action of typing in a search term and hitting the search button!\u2026As you can see Bing is certainly pretty chatty under the covers to give you those search suggestions.<\/p>\n<p>Luckily the only call I actually need is the post to \/Search.\u00a0 While I could run the Web Test like this those other calls will skew the results so lets delete everything but the call to the search page!<\/p>\n<p><strong>Step 4: Add a data source<\/strong><\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/2072.image_thumb_4DB3AEDA.png\" width=\"354\" height=\"348\" \/><\/p>\n<p>In the Web Performance Test editor there is an icon for adding a data source \u2013and while it lists three sources: Database, XML or CSV since this is to be a Cloud Load Test we are limited to either XML or CSV files that can be copied to the Load Test Virtual Machine.\u00a0 In this case I am selecting a CSV file with a single column called \u201cSearch\u201d.\u00a0 If you look at the properties of the data source from within the web test you will get options as to how to traverse the data source: Do Not Move, Random, Sequential or Unique\u2026Unfortunately these settings are ignored in a Cloud Load Test so I am not going to bother changing from the default(sequential).<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/4544.image_thumb_2202E4DE.png\" width=\"441\" height=\"317\" \/><\/p>\n<p>Expanding the search post of my Web Performance Test you will see the parameters used in that post\u2026one of which was the term I typed in: \u201cPQ=Phone Frog\u201d.<\/p>\n<p>Selecting the properties (keyboard shortcut \u201cF4\u201d) you will see the properties to data bind the search value to the data source created above.<\/p>\n<p><strong>Step 6: Run the Web Test<\/strong><\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/3173.image_thumb_166D279F.png\" width=\"898\" height=\"444\" \/><\/p>\n<p>Unfortunately running the web test now not only does it fail\u2026it only fails with the first record in your data source\u2026Grrr!<\/p>\n<p><strong>Step 8: Finish the clean up of the Search post<\/strong><\/p>\n<p>Almost invariably when cleaning up a Web Performance Test it leaves artifacts in the post you care about\u2026and this will also need to be cleaned.<\/p>\n<p>In this case the search post referenced a a hidden form that we need to remove<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/3010.image_thumb_4AA150E5.png\" width=\"629\" height=\"540\" \/><\/p>\n<p>\u00a0<\/p>\n<p><strong>Step 7: Set Web Performance Test Run Count<\/strong><\/p>\n<p>The default for a Web Performance Test is to ONLY run a fixed run count of ONE. To get our Web Performance Test to run through all the rows in our data source you need to open the file called <strong>Local.Testsetting<\/strong> files stored at the Solution level of your Web Performance Test Project and change the Web Test setting to One run per data source.\u00a0 You will see in the image below behind the dialog a test run where I walked through all the rows in my data source \u2013and the last failed.\u00a0 (It failed as the term had an illegal character not allowed by Bing).<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/0880.image_thumb_2199429A.png\" width=\"568\" height=\"488\" \/><\/p>\n<p><strong>Step 8: Creating a Load Test<\/strong><\/p>\n<p>While there is a lot of information that can be supplied to customize your Load test the Wizard does a great job of walking you through it. To get started simply right click on the Web Performance Load Project and choose a new item of type Load Test.<\/p>\n<p>The wizard will automatically start \u2013 and the only setting you MUST fill in is the step requesting which tests do you want to run.\u00a0<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/4024.image_thumb_5CECA858.png\" width=\"568\" height=\"521\" \/><\/p>\n<p><strong>Step 9: Run this as a Cloud Load Test<\/strong><\/p>\n<p>While this step probably has the greatest ramifications in terms of logistics \u2013 it is also one of the easiest steps!\u00a0 Once again opening the file called <strong>Local.Testsetting<\/strong> files stored at the Solution level of your Web Performance Test Project and change the General setting to \u201cRun Test using Visual Studio Online\u201d.\u00a0 By setting this we will create a Virtual machine in an Azure data center, copy your Web Performance Tests, data sources and other needed setup files and run your Load Test from this virtual Machine.<\/p>\n<p>One thing you will notice when make this change is all your other settings \u2013 such as the settings for your Web Performance Tests disappear.\u00a0 The reason for this is the Web Test Settings aren\u2019t used from within a load test\u2013 such as how you run through your data source this MUST be set in the Web Test itself.\u00a0<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/05\/3872.image_thumb_5156EB19.png\" width=\"555\" height=\"426\" \/><\/p>\n<p>For more information on creating a load Test: <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/04\/07\/get-application-performance-data-during-load-runs-with-visual-studio-online.aspx\" title=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/04\/07\/get-application-performance-data-during-load-runs-with-visual-studio-online.aspx\">http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/04\/07\/get-application-performance-data-during-load-runs-with-visual-studio-online.aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>At StarEast I had a couple of Web Performance Tests in my demo solution that people asked about.\u00a0 Namely the Web Tests called:\u00a0 Perfecto_Mobile_IOS5S SEO_Databound As the name suggests with the first Web Test is something I have been working with Perfecto Mobile on some of their new features and hope to have another post [&hellip;]<\/p>\n","protected":false},"author":63,"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-1323","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-testing"],"acf":[],"blog_post_summary":"<p>At StarEast I had a couple of Web Performance Tests in my demo solution that people asked about.\u00a0 Namely the Web Tests called:\u00a0 Perfecto_Mobile_IOS5S SEO_Databound As the name suggests with the first Web Test is something I have been working with Perfecto Mobile on some of their new features and hope to have another post [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/1323","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=1323"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/1323\/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=1323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=1323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=1323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}