<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Offending the testing gods...</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/rogeorge/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/rogeorge/feed.xml</link>
    <description>Robert George offers musings on performance testing.</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:25:28 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Azure Functions: These are my new favorite squirrels.</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/azure-functions-these-are-my-new-favorite-squirrels</link>
      <pubDate>Thu, 16 Nov 2017 01:32:16 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/?p=175</guid>
      <description><![CDATA[[Note: I am actually Amazed that my old blog is still functioning, it certainly has been a long...]]></description>
      <content:encoded><![CDATA[[Note: I am actually Amazed that my old blog is still functioning, it certainly has been a long time]

If you are new to the idea of Server-less Computing and Micro-services this is definitely worth some time to understand how these work and how they can benefit you. One quick benefit is that at the time of this writing your MSDN Azure account gets 1,000,000 executions per month for free, and you don't have to configure any servers, and you can write your code in many languages and have it run against many built in hooks, for example when a file is uploaded to your OneDrive, or an HTTP web hook is invoked, really its amazing, do check this out. <a href="https://azure.microsoft.com/en-us/services/functions/">https://azure.microsoft.com/en-us/services/functions/</a>

This link will take you to the docs for azure functions and executing tests, but it does not offer any guidance on creating a web performance test. <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-test-a-function">https://docs.microsoft.com/en-us/azure/azure-functions/functions-test-a-function</a>

Now since my blog is kind of dusty, I am going to write a blog soon on how to develop a Visual Studio 2017 Web Performance Test that can invoke an Azure Function application. Its actually quite simple to do it, and you may be able to create one with just record/playback and not have to make changes to the test depending on the complexity of the Http GET/POST data. Next post will have the steps to create a web test in Visual Studio.

So stay tuned...]]></content:encoded>
    </item>
    <item>
      <title>WebTestPlugin: AddDaysToCurrentDate</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/webtestplugin-adddaystocurrentdate</link>
      <pubDate>Fri, 17 Aug 2012 08:00:00 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/2012/08/17/webtestplugin-adddaystocurrentdate/</guid>
      <description><![CDATA[A simple WebTestPlugin that Adds specified number of days to the current date....]]></description>
      <content:encoded><![CDATA[<p>A simple WebTestPlugin that Adds specified number of days to the current date.</p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> [</span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af">Description</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">(</span></span><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515">"WebTestPlugin that adds a specified number of days to the current date and stores the new date in a Context Parameter that you specify. Overrides PreWebTest"</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">)]</span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">public</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">class</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af">AddDaysToCurrentDate</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> : </span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af">WebTestPlugin</span></span></span></p>
<p>{</p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">public</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> AddDaysToCurrentDate()</span></span></p>
<p>{</p>
<p>DaysToAdd = 1;</p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> ContextParameterName = </span></span><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515">"FutureDate"</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">;</span></span></p>
<p>}</p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">public</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">override</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">void</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> PreWebTest(</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">object</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> sender, </span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af">PreWebTestEventArgs</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> e)</span></span></p>
<p>{</p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #008000; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#008000"><span style="color: #008000; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#008000"><span style="color: #008000; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#008000">//TODO: Adjust the date format to obtain output needed. Search C# DateTime.Now Formats for examples and msdn documentation</span></span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #008000; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#008000"><span style="color: #008000; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#008000"><span style="color: #008000; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#008000">//Example: FutureDate=Saturday, August 18, 10:49:21, 2012 </span></span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #008000; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#008000"><span style="color: #008000; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#008000"><span style="color: #008000; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#008000">//e.WebTest.Context[ContextParameterName] = DateTime.Now.AddDays(DaysToAdd).ToString("dddd, MMMM dd, HH:mm:ss, yyyy");</span></span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> e.WebTest.Context[ContextParameterName] = </span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af">DateTime</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">.Now.AddDays(DaysToAdd).ToString();</span></span></p>
<p>}</p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> [</span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af">Description</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">(</span></span><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515">"Number of days to add to the current date. Default value is 1."</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">)]</span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> [</span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af">DefaultValue</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">(1)]</span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">public</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">double</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> DaysToAdd { </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">get</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">; </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">set</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">; }</span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> [</span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af">Description</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">(</span></span><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515">"Context Parameter that will hold the new date value. Default value is 'FutureDate'."</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">)]</span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> [</span></span><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af"><span style="color: #2b91af; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#2b91af">DefaultValue</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">(</span></span><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515"><span style="color: #a31515; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#a31515">"FutureDate"</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">)]</span></span></p>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">public</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">string</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"> ContextParameterName { </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">get</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">; </span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;" face="Consolas" size="2" color="#0000ff">set</span></span></span><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2">; }</span></span></p>
<p>}</p>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>WebTest Plugin : SetMaxMinThinkTime</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/webtest-plugin-setmaxminthinktime</link>
      <pubDate>Tue, 17 Jul 2012 12:12:00 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/2012/07/17/webtest-plugin-setmaxminthinktime/</guid>
      <description><![CDATA[WebTest Plugin that dynamically Sets the Maximum or Minimum think time value for each request....]]></description>
      <content:encoded><![CDATA[<p>WebTest Plugin that dynamically Sets the Maximum or Minimum think time value for each request. Options to throw exception if it encounters a think time larger than your max value so it can help to track down tests that have requests with large think times. Overrides the PreRequest event</p>
<p>&nbsp;</p>
<pre>&nbsp;[Description("WebTest&nbsp;Plugin&nbsp;that&nbsp;dynamically&nbsp;Sets&nbsp;the&nbsp;Maximum&nbsp;or&nbsp;Minimum&nbsp;think&nbsp;time&nbsp;value&nbsp;for&nbsp;each&nbsp;request.&nbsp;Overrides&nbsp;the&nbsp;PreRequest&nbsp;event")]
&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;class&nbsp;SetMaxMinThinkTime&nbsp;:&nbsp;WebTestPlugin
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;SetMaxMinThinkTime()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MaxThinkTime&nbsp;=&nbsp;60;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MinThinkTime&nbsp;=&nbsp;0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OutputComments&nbsp;=&nbsp;false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enabled&nbsp;=&nbsp;true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ThrowExceptionIfThresholdExceeded&nbsp;=&nbsp;false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;override&nbsp;void&nbsp;PreRequest(object&nbsp;sender,&nbsp;PreRequestEventArgs&nbsp;e)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//if&nbsp;plugin&nbsp;is&nbsp;disabled&nbsp;output&nbsp;a&nbsp;comment&nbsp;and&nbsp;return
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(Enabled&nbsp;==&nbsp;false)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(OutputComments)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.WebTest.AddCommentToResult(this.ToString()&nbsp;+&nbsp;"&nbsp;Plugin&nbsp;is&nbsp;Disabled,&nbsp;no&nbsp;processing&nbsp;occured.");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//determine&nbsp;if&nbsp;threshold&nbsp;values&nbsp;exceeded&nbsp;and&nbsp;throw&nbsp;if&nbsp;exception&nbsp;enabled
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(((e.Request.ThinkTime&nbsp;&gt;&nbsp;MaxThinkTime)&nbsp;||&nbsp;(e.Request.ThinkTime&nbsp;&lt;&nbsp;MinThinkTime))&nbsp;&amp;&amp;&nbsp;(ThrowExceptionIfThresholdExceeded))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.WebTest.AddCommentToResult(this.ToString()&nbsp;+&nbsp;"&nbsp;Think&nbsp;Time&nbsp;Threshold&nbsp;value&nbsp;exceeded.&nbsp;Think&nbsp;Time&nbsp;=&nbsp;"&nbsp;+&nbsp;e.Request.ThinkTime.ToString());
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;Exception("A&nbsp;Think&nbsp;Time&nbsp;threshold&nbsp;value&nbsp;was&nbsp;exceeded.");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//update&nbsp;think&nbsp;time&nbsp;if&nbsp;greater&nbsp;than&nbsp;MaxThinkTime
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(e.Request.ThinkTime&nbsp;&gt;&nbsp;MaxThinkTime)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.Request.ThinkTime&nbsp;=&nbsp;MaxThinkTime;
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//update&nbsp;think&nbsp;time&nbsp;if&nbsp;less&nbsp;than&nbsp;MinThinkTime
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(e.Request.ThinkTime&nbsp;&lt;&nbsp;MinThinkTime)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.Request.ThinkTime&nbsp;=&nbsp;MinThinkTime;
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(OutputComments)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.WebTest.AddCommentToResult("SetMaxMinThinkTime&nbsp;value&nbsp;=&nbsp;"&nbsp;+&nbsp;e.Request.ThinkTime.ToString());
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Description("Maximum&nbsp;Think&nbsp;Time&nbsp;value&nbsp;for&nbsp;any&nbsp;request")]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DefaultValue(60)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;int&nbsp;MaxThinkTime&nbsp;{&nbsp;get;&nbsp;set;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Description("Minimum&nbsp;Think&nbsp;Time&nbsp;value&nbsp;for&nbsp;any&nbsp;request")]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DefaultValue(0)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;int&nbsp;MinThinkTime&nbsp;{&nbsp;get;&nbsp;set;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Description("Enable&nbsp;output&nbsp;comments&nbsp;added&nbsp;to&nbsp;the&nbsp;test&nbsp;results&nbsp;view.&nbsp;Default&nbsp;is&nbsp;false")]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DefaultValue(false)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;bool&nbsp;OutputComments&nbsp;{&nbsp;get;&nbsp;set;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Description("Enable&nbsp;or&nbsp;Disable&nbsp;the&nbsp;plugin&nbsp;execution.&nbsp;Default&nbsp;is&nbsp;Enabled&nbsp;(true)")]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DefaultValue(true)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;bool&nbsp;Enabled&nbsp;{&nbsp;get;&nbsp;set;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Description("Throw&nbsp;exception&nbsp;when&nbsp;encountering&nbsp;Min&nbsp;or&nbsp;Max&nbsp;values&nbsp;that&nbsp;exceed&nbsp;threshold&nbsp;value.&nbsp;Default&nbsp;is&nbsp;false")]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DefaultValue(false)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;bool&nbsp;ThrowExceptionIfThresholdExceeded&nbsp;{&nbsp;get;&nbsp;set;&nbsp;}
 
 
&nbsp;&nbsp;&nbsp;&nbsp;}</pre>]]></content:encoded>
    </item>
    <item>
      <title>WebTestPlugin: SetLoopTerminatingValue</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/webtestplugin-setloopterminatingvalue</link>
      <pubDate>Tue, 26 Jun 2012 11:46:00 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/2012/06/26/webtestplugin-setloopterminatingvalue/</guid>
      <description><![CDATA[WebTestPlugin - SetLoopTerminatingValue
I created this Visual Studio 2010 webtestplugin which...]]></description>
      <content:encoded><![CDATA[<p>WebTestPlugin - SetLoopTerminatingValue</p>
<p>I created this Visual Studio 2010 webtestplugin which allows you to set the terminating value property of a conditional loop in a Declarative Web Test. As an example you might want to load the terminating value from a data source or other Context Parameter. Add a class to your test project and put this code in the .cs file,be sure to&nbsp;add a using for System.ComponentModel.</p>
<p>The idea for this came from a question posted on the forum here: <a href="https://social.msdn.microsoft.com/Forums/en-US/vstswebtest/thread/fc77f2f6-3e4d-488e-9a01-d87f06ed92e3">https://social.msdn.microsoft.com/Forums/en-US/vstswebtest/thread/fc77f2f6-3e4d-488e-9a01-d87f06ed92e3</a></p>
<p>&nbsp;</p>
<pre class="scroll"><code class="csharp">[Description("WebTestPlugin that sets a Conditional Loop terminating value dynamically in the PreWebTest event to a specified Context Parameter value. If using a datasource, be sure to select All Columns in the datasource properties in case the value your using is not bound in the test.")]<br /> public class SetLoopTerminatingValue : WebTestPlugin<br /> {<br /> [Description("ContextParameter specified in the Conditional Rule to hold the loop counter value. This is used to confirm which conditional rule you want this plugin to work against.")]<br /> public string ConditionalRuleContextParameter { get; set; }<br /> [Description("ContextParameter that holds the value you want to set the TerminatingValue property to in the conditional loop. If this is from a data source the syntax will resemble the following: DataSourc1.DataFile#csv.LoopTerminateValue")]<br /> public string ContextParameterTerminatingValue { get; set; }<br /> public override void PreWebTest(object sender, PreWebTestEventArgs e)<br /> {<br /> DeclarativeWebTest dwt = e.WebTest as DeclarativeWebTest;<br /> foreach (var conditionalRule in dwt.ConditionalRuleReferences)<br /> {<br /> //make sure this is the right conditional rule (they may have more than one) by checking the ContextParameterName that<br /> //the loop counter is using. This was specified by the user so they should be able to get this easily. <br /> if (conditionalRule.Properties["ContextParameterName"] == ConditionalRuleContextParameter)<br /> {<br /> //make sure the context parameter they provided exists before setting terminating value<br /> if (e.WebTest.Context.ContainsKey(ContextParameterTerminatingValue))<br /> {<br /> conditionalRule.Properties["TerminatingValue"] = e.WebTest.Context[ContextParameterTerminatingValue].ToString();<br /> }<br /> else<br /> {<br /> //let them know this does not exist, and this will fail the test execution.<br /> throw new ArgumentException("Context Parameter for the Terminating Value does not exist. Please check for the existense of context parameter specified as '" + ContextParameterTerminatingValue + "'");<br /> }<br /> }<br /> }<br /> }<br /> }</code></pre>
<p>&nbsp;</p>
<pre style="background: white; color: black; font-family: Consolas;">&nbsp;</pre>]]></content:encoded>
    </item>
    <item>
      <title>LoadTestPlugin: Add Scenario Name to TestContext in Unit Test</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/loadtestplugin-add-scenario-name-to-testcontext-in-unit-test</link>
      <pubDate>Wed, 28 Mar 2012 08:59:00 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/2012/03/28/loadtestplugin-add-scenario-name-to-testcontext-in-unit-test/</guid>
      <description><![CDATA[This load test plugin will add the Load Test Scenario name that the test is running in to the...]]></description>
      <content:encoded><![CDATA[<p><b>This load test plugin will add the Load Test Scenario name that the test is running in to the TestContext.Properties. In a unit test, your code would look like this to access the scenario name. With this you could implement some other logic or steps to take based on the load test scenario that this test is running in.</b></p>
<p>Shows how to use the TestContext to access the Value copied<br />into the TestContext from the Load Test Plugin:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="638">
<pre>&nbsp;&nbsp;[TestClass]</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;class&nbsp;UnitTest2</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;{</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;TestContext&nbsp;testContextInstance;</pre>
<pre> </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;///&nbsp;&lt;summary&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;///Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;test&nbsp;context&nbsp;which&nbsp;provides</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;///information&nbsp;about&nbsp;and&nbsp;functionality&nbsp;for&nbsp;the&nbsp;current&nbsp;test&nbsp;run.</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;///&lt;/summary&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;TestContext&nbsp;TestContext</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;testContextInstance;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;testContextInstance&nbsp;=&nbsp;value;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre>
<pre> </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TestMethod]</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;TestMehod2()</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color: #ffff00;">string&nbsp;scenarioName&nbsp;=&nbsp;TestContext.Properties["ScenarioName"].ToString();</span></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;}</pre>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p></p>
<p></p>
<p><span style="font-size: large;"><b>Load Test Plugin</b></span></p>
<p>Add a Class.cs file to the Test Project, then will need to <b>Add<br />Reference to the LoadTestFramework</b> as follows:</p>
<p>Microsoft.VisualStudio.QualityTools.LoadTestFramework</p>
<p>&nbsp;</p>
<p><b>These two using will also be needed, and once you have the source code in you need to compile one time before gong to the Load Test and adding the LoadTest Plugin to the loadtest (right click on the loadtest name in the top node in the loadtest editor in VS, choose Add LoadTest Plugin, select from the list, and now your ready to use this:</b></p>
<p>&nbsp;</p>
<pre>using&nbsp;System.ComponentModel;</pre>
<pre>using&nbsp;Microsoft.VisualStudio.TestTools.LoadTesting;</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="638">
<p>&nbsp;&nbsp;&nbsp;&nbsp;[Description("Load&nbsp;Test&nbsp;Plugin&nbsp;that&nbsp;adds&nbsp;a&nbsp;Context&nbsp;Parameter&nbsp;containing&nbsp;the&nbsp;Test&nbsp;Scenario&nbsp;Name&nbsp;to&nbsp;the&nbsp;Users&nbsp;Context")]</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;class&nbsp;UserTestContextScenarioName&nbsp;:&nbsp;ILoadTestPlugin</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LoadTest&nbsp;loadTest&nbsp;=&nbsp;null;</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Description("Name&nbsp;of&nbsp;the&nbsp;context&nbsp;parameter&nbsp;that&nbsp;will&nbsp;hold&nbsp;the&nbsp;ScenarioName&nbsp;value")]</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DefaultValue("ScenarioName")]</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;string&nbsp;ContextParamName&nbsp;{&nbsp;get;&nbsp;set;&nbsp;}</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;UserTestContextScenarioName()</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContextParamName&nbsp;=&nbsp;"ScenarioName";</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;Initialize(LoadTest&nbsp;loadTestInit)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loadTest&nbsp;=&nbsp;loadTestInit;</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//wire&nbsp;up&nbsp;the&nbsp;TestStarting&nbsp;event,&nbsp;will&nbsp;fire&nbsp;before&nbsp;every&nbsp;test&nbsp;iteration&nbsp;for&nbsp;each&nbsp;VUser</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loadTest.TestStarting&nbsp;+=&nbsp;new&nbsp;EventHandler&lt;TestStartingEventArgs&gt;(loadTest_TestStarting);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void&nbsp;loadTest_TestStarting(object&nbsp;sender,&nbsp;TestStartingEventArgs&nbsp;e)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!string.IsNullOrEmpty(ContextParamName))</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//this&nbsp;adds&nbsp;the&nbsp;ScenarioName&nbsp;to&nbsp;the&nbsp;users&nbsp;test&nbsp;context</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.TestContextProperties.Add(ContextParamName,&nbsp;e.ScenarioName);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;ArgumentNullException("The&nbsp;required&nbsp;value&nbsp;for&nbsp;ContextParamName&nbsp;was&nbsp;null&nbsp;or&nbsp;empty,&nbsp;please&nbsp;specify&nbsp;a&nbsp;name.");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>WebTestPlugin: AppendValueToContextParameter</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/webtestplugin-appendvaluetocontextparameter</link>
      <pubDate>Thu, 08 Mar 2012 20:33:41 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/2012/03/08/webtestplugin-appendvaluetocontextparameter/</guid>
      <description><![CDATA[Here is a plugin that allows you to append any context parameter value to any other context...]]></description>
      <content:encoded><![CDATA[<p>Here is a plugin that allows you to append any context parameter value to any other context parameter. This plugin is a WebTestPlugin that overrides the PreWebTest event, so this will happen before the WebTest executes any requests. You can easily make a variation of this plugin as a WebTestRequestPlugin, and override the PreRequestDataBinding event so that this could append any context param to any other, but would do it before the request you have bound it to. In additon to appending context parameters, you can also just type in a hard coded string value to append and that will also work.</p>
<p>&nbsp;</p>
<pre class="scroll"><code class="csharp"> [System.ComponentModel.Description("WebTestPlugin, Overrides PreWebTest and appends either a context parameter or hard coded string to a specified target Context Parameter. As an example, this plugin could append the built in $WebTestIteration value to an existing datasource column value.")] <br /> public class AppendValueToContextParameter : WebTestPlugin<br /> { <br /> [System.ComponentModel.DefaultValue("DataSource1.SomeDataFile#csv.FieldName")]<br /> [System.ComponentModel.Description("The target context parameter that you would like to append the source context param value")]<br /> public string ContextParamTarget { get; set; }<br /> <br /> [System.ComponentModel.DefaultValue("$WebTestIteration")]<br /> [System.ComponentModel.Description("The source context parameter, or a hard coded string value you would like appended to the target context param")]<br /> public string ContextParamOrValueSource { get; set; }<br /> <br /> public AppendValueToContextParameter()<br /> {<br /> ContextParamOrValueSource = "$WebTestIteration";<br /> ContextParamTarget = "DataSource1.SomeDataFile#csv.FieldName";<br /> }<br /> <br /> public override void PreWebTest(object sender, PreWebTestEventArgs e)<br /> {<br /> //confirm the target context param exists <br /> if (e.WebTest.Context.ContainsKey(ContextParamTarget))<br /> {<br /> //is the ContextParmOrValueSource a Context Parameter or a hard coded value?<br /> if (e.WebTest.Context.ContainsKey(ContextParamOrValueSource))<br /> {<br /> e.WebTest.Context[ContextParamTarget] += e.WebTest.Context[ContextParamOrValueSource].ToString();<br /> }<br /> else //hard coded value<br /> {<br /> e.WebTest.Context[ContextParamTarget] += ContextParamOrValueSource;<br /> } <br /> }<br /> else<br /> {<br /> throw new ArgumentException("Required Context Parameter Target was not found");<br /> }<br /> }<br /> }</code></pre>
<p><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"><span style="font-family: Consolas; font-size: x-small;" face="Consolas" size="2"></span></span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>WebTest Plugin: Random Number</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/webtest-plugin-random-number</link>
      <pubDate>Thu, 23 Feb 2012 12:23:00 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/2012/02/23/webtest-plugin-random-number/</guid>
      <description><![CDATA[Do you need a random number generated in a WebTest, just take the code below and add it to a...]]></description>
      <content:encoded><![CDATA[<p>Do you need a random number generated in a WebTest, just take the code below and add it to a class(.cs) file in your project, recompile once.</p>
<p>Then just right click on your WebTest in the editor and choose Add WebTest Plugin picking this one and you should be good.</p>
<p>Just use the curly brace syntax where your using it in the test just like any context parameter (i.e. {{RandomNumber}} ). You can have it regenerate the random number before every request, or just have it do this only once in the PreWebTest by setting the <b>UpdateBeforeRequest</b> property. If you need more random numbers, you can add more than one instance of this plugin,just remember to set the ContextParameter name to something different .</p>
<p>In the code, if you add the appropriate <b>using System.ComponentModel</b>, then you don&rsquo;t have to put the full syntax as is listed below for the attributes [System.ComponentModel.xxx] you can use [Description(&ldquo;Blah&rdquo;)], etc.</p>
<p>&nbsp;</p>
<pre style="background: white; color: black; font-family: Consolas;">[System.ComponentModel.<span style="color: #2b91af;">Description</span>(<span style="color: #a31515;">"Creates&nbsp;a&nbsp;Random&nbsp;Number&nbsp;and&nbsp;stores&nbsp;the&nbsp;value&nbsp;in&nbsp;the&nbsp;Context&nbsp;Parameter&nbsp;defined.&nbsp;The&nbsp;value&nbsp;can&nbsp;be&nbsp;created&nbsp;once&nbsp;the&nbsp;test&nbsp;starts,&nbsp;or&nbsp;it&nbsp;can&nbsp;be&nbsp;updated&nbsp;before&nbsp;each&nbsp;web&nbsp;request."</span>)]
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span>&nbsp;<span style="color: blue;">class</span>&nbsp;<span style="color: #2b91af;">RandomNumberContextParameter</span>&nbsp;:&nbsp;<span style="color: #2b91af;">WebTestPlugin</span>
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[System.ComponentModel.<span style="color: #2b91af;">Description</span>(<span style="color: #a31515;">"If&nbsp;True,&nbsp;the&nbsp;random&nbsp;number&nbsp;will&nbsp;be&nbsp;recalculated&nbsp;before&nbsp;each&nbsp;request&nbsp;is&nbsp;made.&nbsp;The&nbsp;default&nbsp;is&nbsp;false."</span>)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[System.ComponentModel.<span style="color: #2b91af;">DefaultValue</span>(<span style="color: blue;">false</span>)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span>&nbsp;<span style="color: blue;">bool</span>&nbsp;UpdateBeforeRequest&nbsp;{&nbsp;<span style="color: blue;">get</span>;&nbsp;<span style="color: blue;">set</span>;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[System.ComponentModel.<span style="color: #2b91af;">Description</span>(<span style="color: #a31515;">"Name&nbsp;of&nbsp;the&nbsp;Context&nbsp;Paramter&nbsp;that&nbsp;will&nbsp;stroe&nbsp;the&nbsp;random&nbsp;number."</span>)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[System.ComponentModel.<span style="color: #2b91af;">DefaultValue</span>(<span style="color: #a31515;">"RandomNumber"</span>)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span>&nbsp;<span style="color: blue;">string</span>&nbsp;ContextParameter&nbsp;{&nbsp;<span style="color: blue;">get</span>;&nbsp;<span style="color: blue;">set</span>;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[System.ComponentModel.<span style="color: #2b91af;">DefaultValue</span>(1)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span>&nbsp;<span style="color: blue;">int</span>&nbsp;MinimumValue&nbsp;{&nbsp;<span style="color: blue;">get</span>;&nbsp;<span style="color: blue;">set</span>;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[System.ComponentModel.<span style="color: #2b91af;">DefaultValue</span>(101)]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span>&nbsp;<span style="color: blue;">int</span>&nbsp;MaximumValue&nbsp;{&nbsp;<span style="color: blue;">get</span>;&nbsp;<span style="color: blue;">set</span>;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span>&nbsp;RandomNumberContextParameter()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UpdateBeforeRequest&nbsp;=&nbsp;<span style="color: blue;">false</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContextParameter&nbsp;=&nbsp;<span style="color: #a31515;">"RandomNumber"</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MinimumValue&nbsp;=&nbsp;1;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MaximumValue&nbsp;=&nbsp;100;
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span>&nbsp;<span style="color: blue;">override</span>&nbsp;<span style="color: blue;">void</span>&nbsp;PreWebTest(<span style="color: blue;">object</span>&nbsp;sender,&nbsp;<span style="color: #2b91af;">PreWebTestEventArgs</span>&nbsp;e)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">if</span>&nbsp;(<span style="color: blue;">string</span>.IsNullOrEmpty(ContextParameter))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">throw</span>&nbsp;<span style="color: blue;">new</span>&nbsp;<span style="color: #2b91af;">ArgumentException</span>(<span style="color: blue;">this</span>.ToString()&nbsp;+&nbsp;<span style="color: #a31515;">"Error&nbsp;--&gt;&nbsp;ContextParameter&nbsp;property&nbsp;cannot&nbsp;be&nbsp;null&nbsp;or&nbsp;empty.&nbsp;Please&nbsp;define&nbsp;a&nbsp;context&nbsp;paramater&nbsp;to&nbsp;output&nbsp;the&nbsp;random&nbsp;number."</span>);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">if</span>&nbsp;(MinimumValue&nbsp;&gt;&nbsp;MaximumValue&nbsp;+&nbsp;1)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">throw</span>&nbsp;<span style="color: blue;">new</span>&nbsp;<span style="color: #2b91af;">ArgumentOutOfRangeException</span>(<span style="color: blue;">this</span>.ToString()&nbsp;+&nbsp;<span style="color: #a31515;">"Error&nbsp;--&gt;&nbsp;The&nbsp;property&nbsp;for&nbsp;the&nbsp;MinimumValue&nbsp;must&nbsp;less&nbsp;than&nbsp;or&nbsp;equal&nbsp;to&nbsp;MaximumValue."</span>);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//note&nbsp;the&nbsp;Random.Next()&nbsp;method&nbsp;creates&nbsp;a&nbsp;random&nbsp;number&nbsp;based&nbsp;on&nbsp;the&nbsp;min,&nbsp;and&nbsp;max&nbsp;values,&nbsp;however&nbsp;the&nbsp;max&nbsp;value&nbsp;returnd&nbsp;is&nbsp;one&nbsp;less&nbsp;than&nbsp;specified</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//so&nbsp;we&nbsp;add&nbsp;one&nbsp;here&nbsp;so&nbsp;that&nbsp;it&nbsp;works&nbsp;the&nbsp;way&nbsp;most&nbsp;people&nbsp;would&nbsp;intuitively&nbsp;expect.</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.WebTest.Context[ContextParameter]&nbsp;=&nbsp;<span style="color: blue;">new</span>&nbsp;<span style="color: #2b91af;">Random</span>().Next(MinimumValue,MaximumValue&nbsp;+&nbsp;1).ToString();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span>&nbsp;<span style="color: blue;">override</span>&nbsp;<span style="color: blue;">void</span>&nbsp;PreRequestDataBinding(<span style="color: blue;">object</span>&nbsp;sender,&nbsp;<span style="color: #2b91af;">PreRequestDataBindingEventArgs</span>&nbsp;e)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//if&nbsp;they&nbsp;want&nbsp;a&nbsp;new&nbsp;random&nbsp;number&nbsp;generated&nbsp;for&nbsp;each&nbsp;new&nbsp;request</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">if</span>&nbsp;(UpdateBeforeRequest)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.WebTest.Context[ContextParameter]&nbsp;=&nbsp;<span style="color: blue;">new</span>&nbsp;<span style="color: #2b91af;">Random</span>().Next(MinimumValue,&nbsp;MaximumValue&nbsp;+&nbsp;1).ToString();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
 
&nbsp;&nbsp;&nbsp;&nbsp;}</pre>]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio 2010 Load Test Feature Pack - Provides Unlimited Virtual Users for Load Testing</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/visual-studio-2010-load-test-feature-pack-provides-unlimited-virtual-users-for-load-testing</link>
      <pubDate>Wed, 01 Jun 2011 13:46:08 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/2011/06/01/visual-studio-2010-load-test-feature-pack-provides-unlimited-virtual-users-for-load-testing/</guid>
      <description><![CDATA[This is such a huge thing, I felt like I had to mention it here: 
Unlimited Visual Studio 2010...]]></description>
      <content:encoded><![CDATA[<p>This is such a huge thing, I felt like I had to mention it here: </p>
<p><span style="background-color: #ffffff;">Unlimited </span>Visual Studio 2010 SP1&nbsp;Virtual Users with the <strong>Load Test Feature Pack </strong>now. </p>
<p>Check this link for the details.&nbsp;<a href="https://www.microsoft.com/visualstudio/en-us/products/2010-editions/load-test-virtual-user-pack/overview">https://www.microsoft.com/visualstudio/en-us/products/2010-editions/load-test-virtual-user-pack/overview</a>.&nbsp;</p>
<p>This means&nbsp;where other load testing tools charge based on Virtual User licenses, Microsoft is providing these as an added benefit to those with Visual Studio 2010 Ultimate / MSDN Ultimate subscription. All the more reasons to adopt Visual Studio 2010 Ultimate as your primary Load Testing tool. </p>]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio WebTest Validation Rules - Built-in Response URL rule is case sensitive...</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/visual-studio-webtest-validation-rules-built-in-response-url-rule-is-case-sensitive</link>
      <pubDate>Wed, 01 Jun 2011 13:33:00 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/2011/06/01/visual-studio-webtest-validation-rules-built-in-response-url-rule-is-case-sensitive/</guid>
      <description><![CDATA[&nbsp;The built in Validation Rule, called&nbsp;Response URL is case sensitive, and&nbsp;this rule...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;<span style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;">The built in Validation Rule, called&nbsp;Response URL is case sensitive, and&nbsp;this rule is to help validate that&nbsp;a page that was redirected to another&nbsp;page during recording, also honors the same&nbsp;when playing back&nbsp;via a VS WebTest.&nbsp;The problem is that some web apps don&rsquo;t always respond with urls that are same case as what was recorded, especially if the data used to drive the test might have a virtual user exercise a slightly different code path. So a URL to <a href="https://mysite/mypage.aspx">https://mysite/mypage.aspx</a> is not equivalent to <a href="https://mysite/myPage.aspx">https://mysite/myPage.aspx</a>, well, this may be a bit too restrictive, so the good news is that with Visual Studio we can rely on the extensibility models to get the solution you need. Just replace the built in validation rule with this sample&nbsp;code&nbsp;that I have created below. You can modify this validation rule with additional logic if you desire. Add a class to your project and add the code snippet below, update the namespace if you desire, and be sure you have the using statement for the System.ComponentModel and the TestTools.WebTestingl. Make sure to rebuild the project once so the custom validation rule will show up before you try to add to the .webtest.<o:p></o:p></span></p>
<p><span style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;">&nbsp;<o:p></o:p></span></p>
<p><span style="color: blue;">using</span> System.ComponentModel;<br /><span style="color: blue;">using</span> Microsoft.VisualStudio.TestTools.WebTesting;<br /><br /><span style="color: blue;">namespace</span> TestProject5<br />{<br />&nbsp; [Description(<span style="color: #a31515;">"Validates that the response URL after redirects are followed is the same as the recorded response URL. QueryString parameters are ignored. The match will be done on case insensitive basis."</span>)]<br />&nbsp; [DisplayName(<span style="color: #a31515;">"Response URL Case Insensitive"</span>)]<br />&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">class</span> ResponseURLCaseInsensitive : ValidationRule<br />&nbsp; {<br />&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">override</span> <span style="color: blue;">void</span> Validate(<span style="color: blue;">object</span> sender, ValidationEventArgs e)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: green;">//determine if request is a redirect follow and validate the URL accordingly</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (e.Request.IsRedirectFollow)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: green;">//use to upper to force case insensitive comparision</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (e.Request.ExpectedResponseUrl.ToUpper() == e.Request.Url.ToUpper())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.IsValid = <span style="color: blue;">true</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Message = <span style="color: #a31515;">"Response URL successfully matched case insensitive comparison. Expected Value="</span> + e.Request.ExpectedResponseUrl + <span style="color: #a31515;">" , Actual Value="</span> + e.Request.Url;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">else</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.IsValid = <span style="color: blue;">false</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Message = <span style="color: #a31515;">"Response URL did NOT match. Expected Value="</span> + e.Request.ExpectedResponseUrl + <span style="color: #a31515;">" , Actual Value="</span> + e.Request.Url;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <span style="color: green;">//if the request did not redirect, determine if one was expected and fail if true</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">else</span> <span style="color: blue;">if</span> (!<span style="color: blue;">string</span>.IsNullOrEmpty(e.Request.ExpectedResponseUrl))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.IsValid = <span style="color: blue;">false</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Message = <span style="color: #a31515;">"The expected response redirect did not occur. Expected Response URL="</span> + e.Request.ExpectedResponseUrl;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp; }<br />}</p>]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio WebTest Fails with error "Request failed: Received an unexpected EOF or 0 bytes from the transport stream"</title>
      <link>https://docs.microsoft.com/archive/blogs/rogeorge/visual-studio-webtest-fails-with-error-request-failed-received-an-unexpected-eof-or-0-bytes-from-the-transport-stream</link>
      <pubDate>Tue, 10 Aug 2010 10:38:00 GMT</pubDate>
      <dc:creator><![CDATA[rogeorge]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rogeorge/2010/08/10/visual-studio-webtest-fails-with-error-request-failed-received-an-unexpected-eof-or-0-bytes-from-the-transport-stream/</guid>
      <description><![CDATA[Here is a solution to a problem that some folks have encountered running Visual Studio WebTests...]]></description>
      <content:encoded><![CDATA[<p>Here is a solution to a problem that some folks have encountered running Visual Studio WebTests using HTTPS protocols. Some times there maybe a device (Load Balancer, Firewall, or Application Applicance) that does not support <a target="_blank" href="https://technet.microsoft.com/en-us/library/cc784450(WS.10).aspx" title="TLS/SSL">TLS (Transport Layer Security)</a>. Usually if this issue is present you will get an error message: Request Failed: Received an unexpected EOF or 0 bytes from the transport stream. </p>
<p>So the default in Visual Studio is to use TLS, and not the downlevel SSLv3, but the question may come up , what do we do if we are stuck using a device that requires SSLv3? Well, the extensibility aspects of Visual Studio Test capability are there to help us fix this up. The following sample WebTest plugin shows you how you can override the default TLS. Hope this code sample helps you out if you.</p>
<p><span style="color: blue;"><strong>The following code sample shows how to specify SSL vs. TLS in your WebTests by taking this code, put in a class file, and compile in your test project. Then you would right-click on your WebTest&nbsp;in the Visual Studio design view, and add WebTest Plugin using this plugin.</strong></span></p>
<p><span style="color: blue;"><strong></strong></span></p>
<p><span style="color: blue;">
<pre class="scroll" style="text-align: left;"><code class="csharp">using System;
<br />using System.ComponentModel;
<br />using System.Net;
<br />using System.Net.Security;
<br />using System.Security.Cryptography.X509Certificates;
<br />using Microsoft.VisualStudio.TestTools.WebTesting;
<br />
<br />
<br />namespace ExperimentalTesting
<br />{
<br />    [Description("This plugin will force the underlying System.Net ServicePointManager to negotiate downlevel SSLv3 instead of TLS. WARNING: The servers X509 Certificate will be ignored as part of this process, so verify that you are testing the correct system.")]
<br />    public class SSLv3ForcedPlugin : WebTestPlugin
<br />    {
<br />        [Description("Enable or Disable the plugin functionality")]
<br />        [DefaultValue(true)]
<br />        public bool Enabled {get;set;}
<br />
<br />        public override void PreWebTest(object sender, PreWebTestEventArgs e)
<br />        {
<br />            base.PreWebTest(sender, e);
<br />
<br />            // We're using SSL3 here and not TLS. Without this line, nothing works.
<br />            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
<br />
<br />            //we wire up the callback so we can override  behavior and force it to accept the cert
<br />            ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCB;
<br />
<br />            //let them know we made changes to the service point manager
<br />            e.WebTest.AddCommentToResult(this.ToString() + " has made the following modification-&gt; ServicePointManager.SecurityProtocol set to use SSLv3 in WebTest Plugin.");
<br />        }
<br />        public static bool RemoteCertificateValidationCB(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
<br />        {
<br />            //If it is really important, validate the certificate issuer here.
<br />            //this will accept any certificate
<br />            return true;
<br />        }
<br />    }
<br />}
<br /></code></pre>
</span></p>]]></content:encoded>
    </item>
  </channel>
</rss>