<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Southworks Blogs &#187; Load Testing</title>
	<atom:link href="http://blogs.southworks.net/category/load-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.southworks.net</link>
	<description>Powered by Southworks</description>
	<lastBuildDate>Wed, 05 Jun 2013 14:29:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Visual Studio Load Tests: Troubleshooting Performance Counters Collection Issues</title>
		<link>http://blogs.southworks.net/sdurandeu/2013/01/23/visual-studio-load-tests-troubleshooting-performance-counters-collection-issues/</link>
		<comments>http://blogs.southworks.net/sdurandeu/2013/01/23/visual-studio-load-tests-troubleshooting-performance-counters-collection-issues/#comments</comments>
		<pubDate>Wed, 23 Jan 2013 21:57:00 +0000</pubDate>
		<dc:creator>sdurandeu</dc:creator>
				<category><![CDATA[Load Testing]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://45.273</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/sdurandeu/2013/01/23/visual-studio-load-tests-troubleshooting-performance-counters-collection-issues/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>When performing load testing, Visual Studio allows you to collect <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa373083(v=vs.85).aspx">performance counters</a> from the machines under test, including the controller and agents (which are collected by default). However, when trying to <a href="http://msdn.microsoft.com/en-us/library/ms404704.aspx">add a counter</a> from a remote machine in your Visual Studio Load Test, you might get the following error:<br />
<blockquote>
<p><em>Cant read performance counter categories for computer ‘…’</em></p>
</blockquote>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/SNAGHTML12573ce.png"><img style="margin: 0px" alt="SNAGHTML12573ce" src="http://blogs.southworks.net/sdurandeu/files/2013/01/SNAGHTML12573ce_thumb.png" width="476" height="503"></a></p>
<p>Or you might not get any values when running the load test and then get the following error in the Test Results</p>
<blockquote><p><em>The performance counter category &#8216;Processor Information&#8217; cannot be accessed on computer &#8216;I-NB160&#8242; (Category does not exist.) ; check that the category and computer names are correct.</em></p>
</blockquote>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/image8.png"><img style="margin: 0px" alt="image" src="http://blogs.southworks.net/sdurandeu/files/2013/01/image_thumb8.png" width="833" height="39"></a></p>
<p>To troubleshoot these issues I’ve found the following tips really useful. You have to check them in the machine from which you are trying to collect the counters. My test rig was configured with 1 controller and 2 agents using Windows Server 2008 R2.</p>
<ul>
<li>First, make sure that the user the Controller Service is running under is part of the <strong>Performance Monitor Users</strong> group. Additionally, make sure that the user under which Visual Studio is running is also part of this group.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/image7.png"><img style="margin: 0px" alt="image" src="http://blogs.southworks.net/sdurandeu/files/2013/01/image_thumb7.png" width="404" height="449"></a><br /> 
<li>Then make sure the <strong>Performance Logs and Alerts</strong> and the <strong>Remote Registry</strong> services are started.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image0032.png"><img alt="clip_image003" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image003_thumb2.png" width="987" height="436"></a></p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image0041.png"><img alt="clip_image004" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image004_thumb1.png" width="979" height="332"></a></li>
</ul>
<p>For more details, check these two blog posts I’ve found around this subject: </p>
<ul>
<li><a href="http://blogs.msdn.com/b/edglas/archive/2008/11/19/reading-performance-counters-on-vista-and-server-2008-machines.aspx">http://blogs.msdn.com/b/edglas/archive/2008/11/19/reading-performance-counters-on-vista-and-server-2008-machines.aspx</a>
<li><a href="http://blogs.msdn.com/b/rubel/archive/2011/06/04/issues-while-collecting-counters-during-load-test-execution.aspx">http://blogs.msdn.com/b/rubel/archive/2011/06/04/issues-while-collecting-counters-during-load-test-execution.aspx</a></li>
</ul>
<p>If you want to learn more on how to configure a Test Rig, check <a href="http://blogs.southworks.net/sdurandeu/2013/01/17/visual-studio-load-tests-creating-a-test-rig/">my previous post</a>.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio Load Tests: Creating a Test Rig</title>
		<link>http://blogs.southworks.net/sdurandeu/2013/01/17/visual-studio-load-tests-creating-a-test-rig/</link>
		<comments>http://blogs.southworks.net/sdurandeu/2013/01/17/visual-studio-load-tests-creating-a-test-rig/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 13:33:00 +0000</pubDate>
		<dc:creator>sdurandeu</dc:creator>
				<category><![CDATA[Load Testing]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://45.236</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/sdurandeu/2013/01/17/visual-studio-load-tests-creating-a-test-rig/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>For generating enough user load to simulate a real usage scenario of a web application, multiple computers can be used for running a Visual Studio load test in a distributed environment. This set of computer is known as a test rig, which consists of a single test controller and one or more test agents. A test agent runs tests and can generate simulated load, while the test controller coordinates the test agents and collects the test results. In short, controller and agents are plain Windows 7 or Windows Server 2008 machines with the <a href="http://www.microsoft.com/en-us/download/details.aspx?id=1334">Microsoft Visual Studio Agents</a> installed. For more information on Visual Studio Load Tests, check <a href="http://msdn.microsoft.com/en-us/library/dd293540.aspx">this MSDN section</a>.
<p>In this post I’ll walk you through the steps to setup a Test Rig using Visual Studio 2010. The Test Rig configuration I’ll be implementing is composed of 1 controller, 2 agents, and a separate machine with Visual Studio 2010 Ultimate that connects to the Test Rig for running the tests (Development Machine). I’ve used Windows Server 2008 R2, but you can use Windows 7 Ultimate as well.
<p>In particular, I’ll show you how to configure the Test rig in a <strong>Workgroup configuration, meaning no central Windows domain is present</strong> and thus the machines are not joined to any domain. It is important to know that in this configuration <strong>local users from different machines, with the same name password are treated as the same users</strong>. To better explain this I’ll quote this explanation from a post linked below:<br />
<blockquote>
<p><em>When MACHINE1UserXYZ tries to authenticate to MACHINE2UserXYZ, if the passwords are the same, then on MACHINE2, the UserXYZ is authenticated successfully and is <strong>treated as MACHINEUserXYZ. </strong>Note the last sentence. The user MACHINE1UserXYZ is authenticated as MACHINE2UserXYZ if the passwords are the same.</em></p>
</blockquote>
<h2><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/image3.png"><img alt="image" src="http://blogs.southworks.net/sdurandeu/files/2013/01/image_thumb3.png" width="517" height="274"></a></h2>
<p>If you want more details on some of the procedures, check the following articles I’ve used as the main reference for this post. They are quite old, but they still apply to Visual studio 2010.
<ul>
<li><a href="http://blogs.msdn.com/b/edglas/archive/2007/02/17/load-agent-and-load-controller-installation-and-configuration-guide.aspx">http://blogs.msdn.com/b/edglas/archive/2007/02/17/load-agent-and-load-controller-installation-and-configuration-guide.aspx</a>
<li><a href="http://blogs.msdn.com/b/dgorti/archive/2007/10/02/vstt-controller-and-agent-setup.aspx">http://blogs.msdn.com/b/dgorti/archive/2007/10/02/vstt-controller-and-agent-setup.aspx</a></li>
</ul>
<h2>Prerequisites</h2>
<p>Before starting the agent and controller, check that you have the following prerequisites:</p>
<ol>
<li>One administrator account in all Controller and Agents machines. This account will be used to run the setup on each machine. If possible, try to use the same administrator account name and password in all the machines, it will save you some time.
<li>Install SQL Server (Express or Full) in the Controller Machine for the <a href="http://msdn.microsoft.com/en-us/library/ms182601(v=vs.80).aspx">Load Test Results Store</a>.
<li>Download the <a href="http://www.microsoft.com/en-us/download/details.aspx?id=1334">Visual Studio Agents 2010 ISO</a> installer, which includes the Test Agent and the Test Controller installers as shown in the following picture.</li>
</ol>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image0011.png"><img style="margin: 0px 0px 0px 20px" alt="clip_image001" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image001_thumb1.png" width="448" height="361"></a><br />
<h2>Controller Installation</h2>
<p>Let’s start by installing the Controller.</p>
<ol>
<li>Login to the Controller with an administrator account (meaning member of the <em>Administrators</em> local group).
<li>Open the ‘<strong>Local Users and Groups</strong>’ manager. To do this, open the Start menu, and type <strong>lusrmgr.msc</strong> in the search line and press ENTER. Create these three accounts:
<ul>
<li>A local account for the controller service. Let’s name this account <strong>ControllerService</strong>.
<li>Another local account for the agent service. Let’s name this account&nbsp; <strong>AgentService</strong>.
<li>A user with the same name and password than the account running Visual Studio in the Development Machine (i.e. user logged in into Development Machine). For this post I’ll use my account <strong>sdurandeu</strong>. <font size="3"><em>In my configuration for writing this post, this account was actually a Windows Domain account. However, as the controller machine is not joined to the domain I created a new account with the same name and password.<br /></em></font><br /><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image0092.png"><img style="margin: 0px" alt="clip_image009" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image009_thumb1.png" width="831" height="298"></a></li>
</ul>
<li>Run the Test Controller installer (see prerequisites for link). Set <em>ControllerService</em> as the account for running the test controller. Leave <strong>localhost</strong> for the load testing database to point to the local SQL Server.
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image0021.png"><img alt="clip_image002" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image002_thumb1.png" width="600" height="639"></a><br /> 
<li>Click <strong>Apply Settings</strong> and make sure all steps succeed.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image0031.png"><img style="margin: 0px" alt="clip_image003" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image003_thumb1.png" width="500" height="400"></a><br /> 
<li>Re-open the <strong>Local Users and Groups</strong> manager. To do this, open the Start menu, and type <strong>lusrmgr.msc</strong> in the search line and press ENTER.
<li>Open the <strong>TeamTestAgentService</strong> Group. Add the <strong>AgentService</strong> user account.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image004.png"><img alt="clip_image004" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image004_thumb.png" width="404" height="448"></a><br /> 
<li>Finally, open the <strong>TeamTestControllerUsers</strong> group and add the <strong>ControllerService</strong> account and the user running Visual Studio. This will allow the user running Visual Studio to connect to the Test Rig to run tests (not manage – see next step).</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image006.png"><img alt="clip_image006" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image006_thumb.png" width="404" height="448"></a><br /> 
<li>Finally, add the user running Visual Studio (in this case my account, <em>sdurandeu</em>) to the<strong> TeamTestControllerAdmins</strong> and the <strong>Administrators</strong> group. This will allow you to manage the test rig from Visual Studio (turn off/on agents, restart services, etc.).<br /><em>Actually, in the tests I’ve made I could restart the rig only by adding the sdurandeu user to the Administrators group, it’s seems not necessary to add the user to the TeamTestControllerAdmins group.<br /></em><br /><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image0051.png"><img alt="clip_image005" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image005_thumb1.png" width="404" height="448"></a><br /><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/image4.png"><img alt="image" src="http://blogs.southworks.net/sdurandeu/files/2013/01/image_thumb4.png" width="404" height="448"></a></li>
</ol>
<p>The Controller is ready, now let’s configure the Agent.<br />
<h2>Agent Installation</h2>
<p>Repeat these steps for each agent machine.</p>
<ol>
<li>Login to the Agent machine with an administrator account (meaning member of the <strong>Administrators</strong> local group). If you are not using the same administrator account user name and password, you need to make sure that the user running the setup is a member of local Administrators group<strong> and</strong> a member of the Controller’s Administrators group.
<li>Open the ‘<strong>Local Users and Groups</strong>’ manager. To do this, open the Start menu, and type <strong>lusrmgr.msc</strong> in the search line and press ENTER. Create these three accounts:
<ul>
<li>A local account to allow the controller service to connect to the agent. Let’s name this account <strong>ControllerService</strong>.
<li>Another local account for the agent service. Let’s name this account <strong>AgentService</strong>. </p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/image5.png"><img style="margin: 0px" alt="image" src="http://blogs.southworks.net/sdurandeu/files/2013/01/image_thumb5.png" width="830" height="219"></a></li>
</ul>
<li>Run the Test Controller installer (see prerequisites for link). Set <strong>AgentService</strong> as the account for running the test controller.
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image007.png"><img alt="clip_image007" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image007_thumb.png" width="559" height="499"></a><br /> 
<li>Click <strong>Apply Settings</strong> and make sure all steps succeed.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image008.png"><img style="margin: 0px" alt="clip_image008" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image008_thumb.png" width="501" height="400"></a></li>
</ol>
<p>&nbsp;<br />
<h2>Connecting to the Test Rig from Visual Studio</h2>
<p>Before running the load test from Visual Studio, you need to make sure the test rig is fully operational. To do this, open <b>Visual Studio 2010 Ultimate</b> and go to <b>Tests</b> | <b>Manage Tests Controllers</b>. Type the host name or IP Address of the test controller and make sure all agents are in <b>Ready</b> state as shown below.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image010.png"><img alt="clip_image010" src="http://blogs.southworks.net/sdurandeu/files/2013/01/clip_image010_thumb.png" width="575" height="496"></a></p>
<p>If you get the following error (‘<em>Not all the agents are ready. To manually check the status…’</em>) , an easy fix is to <u>disable the Windows Firewall in the controller and agents</u>. It’s kind of a brute force approach, but might help getting things ready fast. If you want to perform deeper troubleshooting check the following articles:</p>
<ul>
<li>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/vststest/thread/df043823-ffcf-46a4-9e47-1c4b8854ca13">Troubleshooting Guide for Visual Studio Test Controller and Agent</a></p>
<li>
<p><a href="http://msdn.microsoft.com/en-us/library/ms404660.aspx">Troubleshooting Controllers, Agents, and Rigs (MSDN)</a></p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/SNAGHTML5dd78b.png"><img alt="SNAGHTML5dd78b" src="http://blogs.southworks.net/sdurandeu/files/2013/01/SNAGHTML5dd78b_thumb.png" width="466" height="169"></a></p>
</li>
</ul>
<p>One thing that worked for me is to enable <strong>Firewall File and Printer Sharing Inbound Rules</strong> in the agent machines.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/image6.png"><img style="margin: 0px" alt="image" src="http://blogs.southworks.net/sdurandeu/files/2013/01/image_thumb6.png" width="829" height="303"></a>&nbsp;</p>
<p>Hope you find it useful and don’t hesitate to contact me if you have any questions.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load Testing ADFS-Federated SharePoint Applications</title>
		<link>http://blogs.southworks.net/sdurandeu/2013/01/03/load-testing-adfs-federated-sharepoint-applications/</link>
		<comments>http://blogs.southworks.net/sdurandeu/2013/01/03/load-testing-adfs-federated-sharepoint-applications/#comments</comments>
		<pubDate>Thu, 03 Jan 2013 14:27:50 +0000</pubDate>
		<dc:creator>sdurandeu</dc:creator>
				<category><![CDATA[ADFS]]></category>
		<category><![CDATA[Identity]]></category>
		<category><![CDATA[Load Testing]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://45.139</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/sdurandeu/2013/01/03/load-testing-adfs-federated-sharepoint-applications/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>If you create a Visual Studio Load Test for a SharePoint application that uses Federated Authentication using ADFS (Active Directory Federation Services), you might end in a situation where each Web tests request of the Load Test does not arrive to the application, but is stuck in an ADFS redirection like this:</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2012/12/image1.png"><img alt="image" src="http://blogs.southworks.net/sdurandeu/files/2012/12/image_thumb1.png" width="787" height="339"></a></p>
<p>Without getting into the technical details, the error message you see (‘<em>Script is disabled. Click submit to continue</em>’), is because the <a href="http://msdn.microsoft.com/en-us/library/ff520100.aspx">Visual Studio Test Engine</a> does not support JavaScript and thus the automatic POST of the SAML token into the Relying Party (i.e. your application) does not work (more details <a href="http://social.technet.microsoft.com/wiki/contents/articles/ad-fs-2-0-quot-script-is-disabled-click-submit-to-continue-quot.aspx">here</a>).</p>
<p>In these cases, before actually being able to perform a successful request that hits your SharePoint application, you will need to perform an explicit authentication request to ADFS to get a valid Authentication cookie (AKA <strong>FedAuth</strong> cookie) and send this cookie in all subsequent requests. This will make the request an &#8216;authenticated request&#8217;, avoiding the redirection to ADFS and thus the error above. <strong>Throughout this post you will learn how to implement this flow within a Load Test by creating a Login Web Test that authenticates Virtual Users in ADFS. </strong></p>
<p><span style="text-decoration: underline"><strong>Disclaimer:</strong></span> T<em>o keep things as short as possible I won&#8217;t get in Visual Studio Load Testing or ADFS details. I will assume that you&#8217;ve used VS Testing platform before and you are somehow familiar with ADFS. If you want VS Load Testing documentation </em><a href="http://blogs.msdn.com/b/edglas/archive/2007/12/17/content-index-for-web-tests-and-load-tests.aspx"><em>this post</em></a><em> has a comprehensive set of links. Additionally, I&#8217;ve also found this </em><a href="http://www.scribd.com/doc/40269048/Visual-Studio-Performance-Testing-Quick-Reference-Guide#outer_page_37"><em>Visual Studio Performance Testing Quick Reference Guide</em></a><em> a gem; it is a bit more advanced, but very complete, covering lots of specific cases. Finally, notice that I will&nbsp; assume some ADFS and SharePoint configurations, but I’ll try to make them explicit.</em></p>
<p><strong>1.</strong> To start I&#8217;d suggest that you use <a href="http://www.fiddler2.com/fiddler2/">Fiddler</a> to inspect a normal authentication flow in your SharePoint application. <u>Assuming ADFS is configured for Windows Integrated Authentication</u>, you should get a set of redirections, be prompted for your username/password, and arrive to your target application with a valid FedAuth cookie. Check the last request to ADFS and take note of the <strong>wa </strong>(the operation name), <strong>wrealm</strong> (your application identifier) and <strong>wctx </strong>(in this case the app return URL after ADFS sign in)<strong> </strong>querystring values. Make sure you copy the values as they are, including the URL encoding.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/auth-flow-fiddler.png"><img alt="auth-flow-fiddler" src="http://blogs.southworks.net/sdurandeu/files/2013/01/auth-flow-fiddler_thumb.png" width="900" height="300"></a></p>
<p><strong>2.</strong> Now let&#8217;s switch to Visual Studio. On a new Web Test, let&#8217;s add a new request to the ADFS Integrated Login URL (<em>&#8230;/adfs/ls/auth/integrated</em>) passing the <strong>wa</strong>, <strong>wtrealm</strong> and <strong>wctx</strong> values you&#8217;ve obtained as QueryString Parameters. Then add three Form Field <a href="http://msdn.microsoft.com/en-us/library/ms182545(v=vs.100).aspx">extraction rules</a> for the following values: <strong>wa</strong>, <strong>wctx</strong>, <strong>wresult</strong>. Make sure the corresponding <a href="http://msdn.microsoft.com/en-us/library/ff357728(v=vs.100).aspx">Context Parameters</a> are created in the Web test.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/adfs-request.png"><img alt="adfs-request" src="http://blogs.southworks.net/sdurandeu/files/2013/01/adfs-request_thumb.png" width="745" height="396"></a></p>
<p>This will perform a Windows Integrated authentication request simulating part of a normal federated authentication flow. After Visual Studio provides valid AD credentials (configured in the Web Test properties as shown below), ADFS will return a valid SAML Token in the <strong>wresult</strong> form field of the response. With the Extraction Rules, Visual Studio will extract the SAML Token value and place it the <strong>wresult </strong>Context Parameter for using it in the next request you will create (<em>wa</em> and <em>wresult</em> will also be extracted and re-sent).</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2012/12/credentials1.png"><img class="alignnone size-full wp-image-148" alt="" src="http://blogs.southworks.net/sdurandeu/files/2012/12/credentials1.png" width="435" height="332"></a></p>
<p><strong>3.</strong> Now you need to add another request to the Web Test for posting the SAML token to the SharePoint application. To do this, you should create a request to the Sharepoint STS URL (<em>/_trust/</em>) under your SharePoint application, passing the <strong>wa</strong>, <strong>wctx</strong> and <strong>wresult</strong> context parameters (the <em>{{&#8230;}}</em> pattern indicates the use of context parameters values). The response of this request will have a valid <strong>FedAuth</strong> cookie, which will be automatically stored by Visual Studio in a cookie container and sent back on subsequent requests to the application under test.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2012/12/sharepoint-request1.png"><img class="alignnone size-full wp-image-151" alt="" src="http://blogs.southworks.net/sdurandeu/files/2012/12/sharepoint-request1.png" width="520" height="338"></a></p>
<p><strong>4.</strong> It&#8217;s also a good idea to add a final request to the application under test to make sure authentication worked as expected. Ideally, a <a href="http://msdn.microsoft.com/en-us/library/ms182544(v=vs.100).aspx">Validation Rule</a> should be added to ensure that the request is indeed reaching the application and not bouncing back to ADFS for authentication. For example, you can add a validation rule that parses some user identifier value present in the page.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2012/12/app-request.png"><img class="alignnone size-full wp-image-152" alt="" src="http://blogs.southworks.net/sdurandeu/files/2012/12/app-request.png" width="554" height="274"></a></p>
<p><strong>5.</strong> Let&#8217;s now run the Web Test stand-alone to make sure it&#8217;s working as expected.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2013/01/successful-test.png"><img alt="successful-test" src="http://blogs.southworks.net/sdurandeu/files/2013/01/successful-test_thumb.png" width="979" height="243"></a></p>
<p><strong>6.</strong> Good, you now have a Visual Studio Web Test that performs login with ADFS and gets back a valid FedAuth cookie. So let&#8217;s see how this can be used within a Load Test. When creating a Test Mix you can specify an <strong>Initialize</strong> test, which is run by each Virtual User before any of the tests in the Test Mix are executed. This way each Virtual User will first login in ADFS and get a valid FedAuth cookie before executing other Web Test to add load to your application. All subsequent load test requests performed will hit your application directly, without redirecting to ADFS and thus seeing the error from the beginning of this post.</p>
<p><a href="http://blogs.southworks.net/sdurandeu/files/2012/12/test-mix.png"><img class="alignnone size-full wp-image-155" alt="" src="http://blogs.southworks.net/sdurandeu/files/2012/12/test-mix.png" width="925" height="539"></a></p>
<p>Please notice that if the testing time exceeds the validity period of the FedAuth cookie all the Web Tests of your Load Test will start to fail. The expiration time of the FedAuth cookie in SharePoint is set to 10 hours by default, but in your environment this might differ &#8211; check <a href="http://social.msdn.microsoft.com/Forums/en-US/sharepointadminprevious/thread/47329430-426c-4366-8400-266f62935404">this thread</a> with more information on how to check it.</p>
<p>Thanks to Rodrigo Molinas (<a href="https://twitter.com/romolinas">@romolinas</a>) and Sebastian Ballarati (<a href="https://twitter.com/SBallarati">@sballarati</a>) for their contribution in the code for this post.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio Load Testing: Optimizing Performance Lab Time</title>
		<link>http://blogs.southworks.net/gabrielsz/2009/06/04/visual-studio-load-testing-optimizing-performance-lab-time/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2009/06/04/visual-studio-load-testing-optimizing-performance-lab-time/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 20:00:35 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Load Testing]]></category>
		<category><![CDATA[Performance Testing]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://22.43</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/gabrielsz/2009/06/04/visual-studio-load-testing-optimizing-performance-lab-time/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>When modeling a Web Application&#8217;s responsiveness with an increasing User Load, you usually configure a Load Test Mix with a Step based Load Pattern, run the test until the Response Time goes above a certain response time, and then manually stop the test. This requires some of your time monitoring the test progress and having to intervene to stop the test.</p>
<p> <img src="http://blogs.southworks.net/gabrielsz/files/2009/06/image.png" border="0" alt="image" width="640" height="340" /></p>
<p>Wouldn&#8217;t be nice if this was automated? Fortunately this can be easily achieved through the use of a custom Load Test Plugin (ILoadTestPlugin) and a configured Threshold. (Custom load test plugins were improved in VS2008SP1 and are also available in VS 2010, used in the creation of this blog post.) This will save you (the Tester) the trouble of having to manually monitor the load test and stop it when the threshold is exceeded.<br />
<img src="http://blogs.southworks.net/gabrielsz/files/2009/06/image1.png" border="0" alt="image" width="640" height="106" /></p>
<p>Let&#8217;s take a look at how this can be implemented in code:</p>
<h2>Creating a Load Test Plug-in that stops the Load Test when a threshold is exceeded</h2>
<p>Load Test Plug-ins allow custom code to be executed when a load test starts, ends, or when a threshold was exceeded, among other events. We&#8217;ll create a Custom Load Test Plug-in that attaches itself to the <strong>ThresholdExceeded</strong> event and stops the test.</p>
<ol>
<li>Create a Class Library project.</li>
<li>Add a reference to the <strong>Microsoft.VisualStudio.QualityTools.LoadTestFramework</strong> assembly.</li>
<li>Create a class named <strong>CustomLoadTestPlugin</strong> and complete it with the following code (VS2008 and VS2010):
<p><!-- begin code paste --></p>
<p class="MsoNormal">
<pre><span style="color: blue">using </span>System;
<span style="color: blue">using </span>Microsoft.VisualStudio.TestTools.LoadTesting;

<span style="color: blue">public class </span><span style="color: #2b91af">CustomLoadTestPlugin </span>: ILoadTestPlugin
{
    <span style="color: blue">private </span>LoadTest test;

    <span style="color: blue">public void </span>Initialize(LoadTest loadTest)
    {
        <span style="color: blue">if </span>(loadTest == <span style="color: blue">null</span>)
        {
            <span style="color: blue">throw new </span><span style="color: #2b91af">ArgumentNullException</span>(<span style="color: #a31515">&quot;loadTest&quot;</span>);
        }

        <span style="color: blue">this</span>.test = loadTest;

        loadTest.ThresholdExceeded += <span style="color: blue">new </span><span style="color: #2b91af">EventHandler</span>&lt;ThresholdExceededEventArgs&gt;(OnThresholdExceeded);
    }

    <span style="color: blue">void </span>OnThresholdExceeded(<span style="color: blue">object </span>sender, ThresholdExceededEventArgs e)
    {
        <span style="color: blue">if </span>(e.ThresholdResult == ThresholdRuleResult.Critical
            &amp;&amp; e.CounterValue != <span style="color: blue">null
            </span>&amp;&amp; e.CounterValue.CounterName == <span style="color: #a31515">&quot;Avg. Test Time&quot;</span>)
        {
            <span style="color: blue">this</span>.test.Scenarios[0].CurrentLoad = 0;
            <span style="color: blue">this</span>.test.Abort();
        }
    }
}</pre>
<p><!-- end code paste -->
</li>
<li>Build the Load Test Plug-in solution</li>
</ol>
<p><em>Note: If you&#8217;d like to get more information about creating a Load Test Plug-in, see the following </em><a href="http://msdn.microsoft.com/en-us/library/ms243153.aspx"><em>link</em></a><em>.</em></p>
<h2>Using the Custom Load Test Plug-in</h2>
<ol>
<li>Open the Load Test Configuration (.loadtest) you&#8217;d like to modify.</li>
<li>Using Solution Explorer, add a reference to the Load Test Plug-In (either to the Load Test Plug-In project or to the compiled assembly).</li>
<li>Add a Compare Constant threshold rule on the Avg. Test Time counter. To do this, Expand the <strong>Counter Sets</strong> | <strong>LoadTest</strong> | <strong>Counter Categories</strong> | <strong>LoadTest:Test</strong> element, right click on the <strong>Avg. Test Time</strong> counter and select <strong>Add Threshold Rule</strong>.<img src="http://blogs.southworks.net/gabrielsz/files/2009/06/image2.png" border="0" alt="image" width="395" height="459" /></li>
<li>Add the Load Test Plug-In to the test run. To do this, right click on the Load Test Name (the top element) and choose Add Load Test Plug-in. On the window that opens, select CustomLoadTestPlugin and hit OK.
<p><img src="http://blogs.southworks.net/gabrielsz/files/2009/06/image3.png" border="0" alt="image" width="192" height="103" /></li>
<li>That&#8217;s it, you should now run the Load Test and see if it stops after your configured threshold.</li>
</ol>
<p>Hope this saves you time. If you&#8217;d like to learn more ways to extend Visual Studio Load Testing, check <a href="http://blogs.msdn.com/billbar/">Bill Barnett&#8217;s</a>  <a href="http://blogs.msdn.com/billbar/articles/533216.aspx">article</a>.</p>
<h2>Related Articles</h2>
<ul>
<li><a title="Permanent Link to Visual Studio 2010- How to create a Performance Data Collector" href="http://blogs.southworks.net/gabrielsz/2009/05/21/visual-studio-2010-how-to-create-a-performance-data-collector/">Visual Studio 2010- How to create a Performance Data Collector</a></li>
</ul>
<p>Happy testing!</p>
<div id="39136f40-7337-440e-afbb-e5e3f4fafdb6" class="wlWriterEditableSmartContent" style="padding-bottom: 0px;margin: 0px;padding-left: 0px;padding-right: 0px;float: none;padding-top: 0px">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Load+Testing">Load Testing</a>,<a rel="tag" href="http://technorati.com/tags/Performance+Testing">Performance Testing</a>,<a rel="tag" href="http://technorati.com/tags/Visual+Studio">Visual Studio</a></div>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.southworks.net%2fgabrielsz%2f2009%2f06%2f04%2fvisual-studio-load-testing-optimizing-performance-lab-time%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.southworks.net%2fgabrielsz%2f2009%2f06%2f04%2fvisual-studio-load-testing-optimizing-performance-lab-time%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance back to back at CodeCamp 08</title>
		<link>http://blogs.southworks.net/mwoloski/2008/10/03/performance-back-to-back-at-codecamp-08/</link>
		<comments>http://blogs.southworks.net/mwoloski/2008/10/03/performance-back-to-back-at-codecamp-08/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 23:34:40 +0000</pubDate>
		<dc:creator>Matias Woloski</dc:creator>
				<category><![CDATA[CodeCamp08]]></category>
		<category><![CDATA[High Performance WebSites]]></category>
		<category><![CDATA[Load Testing]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://24.345</guid>
		<description><![CDATA[... <a href="http://blogs.southworks.net/mwoloski/2008/10/03/performance-back-to-back-at-codecamp-08/" class="more-link">read more<img src="http://blogs.southworks.net/wp-content/themes/southworks/assets/img/arrow-blue.png" width="12" height="12" alt="" /></a>]]></description>
			<content:encoded><![CDATA[<p>Tomorrow I will be at <a href="http://www.microsoft.com/Argentina/CodeCamp/">CodeCamp</a> talking about performance on two different presentations. One of them is a<img style="margin: 10px" src="http://blogs.southworks.net/mwoloski/files/2008/10/image.png" border="0" alt="image" width="244" height="48" align="right" />bout the front end performance of web applications (a similar talk to the one <a href="http://blogs.southworks.net/mwoloski/2008/06/10/mix-essentials-high-performance-web-sites-with-aspnet/">presented at MIX last june</a>), but this time I will do it with <a href="http://blogs.southworks.net/parancibia">Paulo Arancibia</a>.</p>
<p>In the other presentation I will join <a href="http://blogs.southworks.net/fboerr">Federico Boerr</a> and together we will try to demystified performance and load testing based on real world experience.</p>
<p>Since the audience will be half students and half professional developers, we decided to do both presentations in a extremely pragmatic fashion, showing tips &amp; tricks. The deck of one of the presentations has just 3 slides! I will post them after the event, but here you have a preview:</p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td width="200" valign="top"><a href="http://blogs.southworks.net/mwoloski/files/2008/10/image1.png"><img src="http://blogs.southworks.net/mwoloski/files/2008/10/image-thumb.png" border="0" alt="image" width="324" height="244" /></a></td>
<td width="200" valign="top"><a href="http://blogs.southworks.net/mwoloski/files/2008/10/image2.png"><img src="http://blogs.southworks.net/mwoloski/files/2008/10/image-thumb1.png" border="0" alt="image" width="324" height="239" /></a></td>
</tr>
<tr>
<td width="200" valign="top"><strong>Presentation (3 &#8211; 4 PM)</strong>: 14 rules for web app performance improvement</td>
<td width="200" valign="top"><strong>Presentation (4:15 &#8211; 5:15 PM)</strong>: How To: Perf and Load Testing</td>
</tr>
</tbody>
</table>
<p> </p>
<p>On the other hand, <a href="http://www.southworks.net">Southworks</a> is one of the sponsors of the event and several other <em><strong>southies</strong></em> will be presenting as well (actually 7 presentations, wow!):</p>
<ul>
<li><a href="http://blogs.southworks.net/jhalife/">Johnny</a> and <a href="http://blogs.southworks.net/pdamiani">Lito</a> about the Microsoft Data platform with SQL (they will do the <a href="http://blogs.msdn.com/zowens/archive/2008/06/05/teched-2008-developers-a-mi-gente-de-southworks-es.aspx">demo that Southworks prepared for BillG KeyNote at TechEd Orlando 2008</a>)</li>
<li><a href="http://blogs.southworks.net/aortega">Beto</a> y <a href="http://blogs.southworks.net/ejadib">Ezequiel Jadib</a> will do a dev + IT talk on application health monitoring</li>
<li><a href="http://blogs.southworks.net/msalias">Martin Salias</a> on his usual and great dynamic languages talk (Python on .NET)</li>
<li><a href="http://msmvps.com/blogs/lopez/default.aspx">Angel Lopez</a> is covering one of the speakers and will do one of our favorites topics: MS Robotics Studio</li>
<li><a href="http://blogs.southworks.net/aalvarez">Augusto Alvarez</a> on IIS7</li>
</ul>
<p><a href="http://www.southworks.net">Southworks</a> will have a booth as well, so feel free to stop by for some geek talks!</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
