<?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>进化的测试 &#187; VSTS</title>
	<atom:link href="http://magustest.com/blog/tag/vsts/feed/" rel="self" type="application/rss+xml" />
	<link>http://magustest.com/blog</link>
	<description>关注软件测试，白盒测试，自动化测试，性能测试</description>
	<lastBuildDate>Tue, 31 Aug 2010 16:19:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>自己动手创建Web测试验证规则</title>
		<link>http://magustest.com/blog/automationtesting/adding-web-test-verifaction-rule/</link>
		<comments>http://magustest.com/blog/automationtesting/adding-web-test-verifaction-rule/#comments</comments>
		<pubDate>Tue, 26 May 2009 02:32:25 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[自动化测试]]></category>
		<category><![CDATA[VSTS]]></category>
		<category><![CDATA[WebTest]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=516</guid>
		<description><![CDATA[”Web测试”是由一系列 HTTP 请求组成，通过发出 HTTP 请求在协议层工作的测试类型。在VSTS中自带了若干个预先定义好的验证规则，例如在返回的页面上寻找某些字符，返回的文档中是否包含某些Tag，等等。前一段时间在测试一个安全过滤器，这个过滤器的基本功能就是过滤用户输入中的一些有可能构成安全隐患的内容，例如&#60;script&#62;标签的内容，JS内容等等。按照预先给出的测试用例执行完测试以后，OK，没有问题，不过在上线一个小时后发现一个问题，就是经过安全过滤器输出的内容会比原来输入的内容多了两个字符&#8211;“rn”，这个问题一下就修复好了，Trim一下。然后我就要给原来的测试加上对于这个问题的回归测试实现。很不巧，Web测试没有一个对返回内容长度进行验证的验证规则，不过微软提供了创建自定义验证规则的接口，我们可以创建一个验证ContentLength的规则。 1. 创建一个新的类库项目，这个项目是一个独立的可重用的类库，所创建的Web测试插件可以在不同的包含有Web测试的项目中使用。其实可以跟上一篇文章说的WebTest Plugin公用一个类库项目 2. 在该类库项目中添加对“Microsoft.VisualStudio.QualityTools.WebTestFramework”的引用 3. 在该类库项目中创建一个从ValidationRule派生出的类 4. 重写基类的Validate方法 5. 打开包含有Web Test的项目，并且在该项目中引用刚才添加的包含有自定义验证规则的类库项目 6. 打开需要调用自定义验证规则的Web测试，点击”Add Validation Rule”，选择刚才编写好的验证规则。 现在看看在自定义验证规则中添加参数，让用户输入相应的参数，从而使得验证规则更加灵活。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 public class ResponseContentLength : ValidationRule &#123; public int Length &#123; get; set; &#125; //输入的长度 public bool [...]


Related posts:<ol><li><a href='http://magustest.com/blog/automationtesting/create-web-test-plugin-in-vsts/' rel='bookmark' title='Permanent Link: 在VSTS中创建Web Test的插件'>在VSTS中创建Web Test的插件</a></li>
<li><a href='http://magustest.com/blog/whiteboxtesting/using-linq-to-object-in-testing/' rel='bookmark' title='Permanent Link: Linq to Object在测试中的应用'>Linq to Object在测试中的应用</a></li>
<li><a href='http://magustest.com/blog/automationtesting/data-driven-codedui-test/' rel='bookmark' title='Permanent Link: 实现数据驱动的CodedUI Test'>实现数据驱动的CodedUI Test</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>”Web测试”是由一系列 HTTP 请求组成，通过发出 HTTP 请求在协议层工作的测试类型。在VSTS中自带了若干个预先定义好的验证规则，例如在返回的页面上寻找某些字符，返回的文档中是否包含某些Tag，等等。前一段时间在测试一个安全过滤器，这个过滤器的基本功能就是过滤用户输入中的一些有可能构成安全隐患的内容，例如&lt;script&gt;标签的内容，JS内容等等。按照预先给出的测试用例执行完测试以后，OK，没有问题，不过在上线一个小时后发现一个问题，就是经过安全过滤器输出的内容会比原来输入的内容多了两个字符&#8211;“rn”，这个问题一下就修复好了，Trim一下。然后我就要给原来的测试加上对于这个问题的回归测试实现。很不巧，Web测试没有一个对返回内容长度进行验证的验证规则，不过微软提供了创建自定义验证规则的接口，我们可以创建一个验证ContentLength的规则。</p>
<p>1. 创建一个新的类库项目，这个项目是一个独立的可重用的类库，所创建的Web测试插件可以在不同的包含有Web测试的项目中使用。其实可以跟上一篇文章说的WebTest Plugin公用一个类库项目</p>
<p>2. 在该类库项目中添加对“Microsoft.VisualStudio.QualityTools.WebTestFramework”的引用</p>
<p>3. 在该类库项目中创建一个从ValidationRule派生出的类</p>
<p>4. 重写基类的Validate方法</p>
<p>5. 打开包含有Web Test的项目，并且在该项目中引用刚才添加的包含有自定义验证规则的类库项目</p>
<p>6. 打开需要调用自定义验证规则的Web测试，点击”Add Validation Rule”，选择刚才编写好的验证规则。</p>
<p>现在看看在自定义验证规则中添加参数，让用户输入相应的参数，从而使得验证规则更加灵活。<br />
<span id="more-516"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> ResponseContentLength <span style="color: #008000;">:</span> ValidationRule
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">int</span> Length <span style="color: #000000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>                   <span style="color: #008080; font-style: italic;">//输入的长度</span>
	<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> PassIfEqualsToContentLength <span style="color: #000000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> Validate<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, ValidationEventArgs e<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">Response</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			e.<span style="color: #0000FF;">IsValid</span> <span style="color: #008000;">=</span> <span style="color: #008000;">!</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">Response</span>.<span style="color: #0000FF;">ContentLength</span> <span style="color: #008000;">==</span> Length<span style="color: #000000;">&#41;</span> <span style="color: #008000;">^</span> PassIfEqualsToContentLength<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span>e.<span style="color: #0000FF;">IsValid</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			e.<span style="color: #0000FF;">Message</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;The length of the ContentLength: {0} is not equal to the expected result: {1}.&quot;</span>, e.<span style="color: #0000FF;">Response</span>.<span style="color: #0000FF;">ContentLength</span>, Length<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>如果我们添加该自定义规则，那么会提示我们输入两个参数，一个是Length，另一个是一个布尔值；如果Response中的ContentLength和设置的Length相等，并且该布尔值设置为True，那么这个验证规则就算是通过。如图：</p>
<p><img src="http://magustest.com/blog/wp-content/uploads/2009/05/5-26-2009-10-26-01-am1.png" alt="5-26-2009-10-26-01-am" title="5-26-2009-10-26-01-am" width="560" height="426" class="alignnone size-full wp-image-517" /></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fadding-web-test-verifaction-rule%2F&amp;t=%E8%87%AA%E5%B7%B1%E5%8A%A8%E6%89%8B%E5%88%9B%E5%BB%BAWeb%E6%B5%8B%E8%AF%95%E9%AA%8C%E8%AF%81%E8%A7%84%E5%88%99" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fadding-web-test-verifaction-rule%2F&title=%E8%87%AA%E5%B7%B1%E5%8A%A8%E6%89%8B%E5%88%9B%E5%BB%BAWeb%E6%B5%8B%E8%AF%95%E9%AA%8C%E8%AF%81%E8%A7%84%E5%88%99" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fadding-web-test-verifaction-rule%2F&title=%E8%87%AA%E5%B7%B1%E5%8A%A8%E6%89%8B%E5%88%9B%E5%BB%BAWeb%E6%B5%8B%E8%AF%95%E9%AA%8C%E8%AF%81%E8%A7%84%E5%88%99&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=%E8%87%AA%E5%B7%B1%E5%8A%A8%E6%89%8B%E5%88%9B%E5%BB%BAWeb%E6%B5%8B%E8%AF%95%E9%AA%8C%E8%AF%81%E8%A7%84%E5%88%99&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fadding-web-test-verifaction-rule%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fadding-web-test-verifaction-rule%2F&amp;title=%E8%87%AA%E5%B7%B1%E5%8A%A8%E6%89%8B%E5%88%9B%E5%BB%BAWeb%E6%B5%8B%E8%AF%95%E9%AA%8C%E8%AF%81%E8%A7%84%E5%88%99" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=%E8%87%AA%E5%B7%B1%E5%8A%A8%E6%89%8B%E5%88%9B%E5%BB%BAWeb%E6%B5%8B%E8%AF%95%E9%AA%8C%E8%AF%81%E8%A7%84%E5%88%99&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fadding-web-test-verifaction-rule%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%E8%87%AA%E5%B7%B1%E5%8A%A8%E6%89%8B%E5%88%9B%E5%BB%BAWeb%E6%B5%8B%E8%AF%95%E9%AA%8C%E8%AF%81%E8%A7%84%E5%88%99%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fadding-web-test-verifaction-rule%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/automationtesting/create-web-test-plugin-in-vsts/' rel='bookmark' title='Permanent Link: 在VSTS中创建Web Test的插件'>在VSTS中创建Web Test的插件</a></li>
<li><a href='http://magustest.com/blog/whiteboxtesting/using-linq-to-object-in-testing/' rel='bookmark' title='Permanent Link: Linq to Object在测试中的应用'>Linq to Object在测试中的应用</a></li>
<li><a href='http://magustest.com/blog/automationtesting/data-driven-codedui-test/' rel='bookmark' title='Permanent Link: 实现数据驱动的CodedUI Test'>实现数据驱动的CodedUI Test</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/automationtesting/adding-web-test-verifaction-rule/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在VSTS中创建Web Test的插件</title>
		<link>http://magustest.com/blog/automationtesting/create-web-test-plugin-in-vsts/</link>
		<comments>http://magustest.com/blog/automationtesting/create-web-test-plugin-in-vsts/#comments</comments>
		<pubDate>Fri, 22 May 2009 05:17:47 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[自动化测试]]></category>
		<category><![CDATA[VSTS]]></category>
		<category><![CDATA[WebTest]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=508</guid>
		<description><![CDATA[做过单元测试的朋友都知道，几乎每一个单元测试的框架都提供了类似于TestInitialize、TestCleanup这样的操作，可以在测试的开始和完成测试以后让我们处理一些问题，例如初始化一些数据，或者销毁一些数据等操作。在VSTS中有一种测试类型叫&#8221;Web测试&#8221;，它由一系列 HTTP 请求组成，通过发出 HTTP 请求在协议层工作。Web测试没有单独的TestInitialize、TestCleanup操作，但是VSTS所提供的Web Test插件能够帮助我们完成这样的工作。以下是MSDN对Web测试的定义： 使用 Web 测试插件，可以隔离代码并在 Web 测试中的主要声明性语句外部重用代码。自定义的 Web 测试插件为在运行 Web 测试时调用某些代码提供了途径。在每个测试迭代中，Web 测试插件都要运行一次。此外，如果重写测试插件中的 PreRequest 或 PostRequest 方法，这些请求插件将分别在每个请求之前或之后运行。 可见Web测试插件给使用者带来了很大的灵活性，下面就看看如何创建一个Web测试插件。 1. 创建一个新的类库项目，这个项目是一个独立的可重用的类库，所创建的Web测试插件可以在不同的包含有Web测试的项目中使用。 2. 在该类库项目中添加对“Microsoft.VisualStudio.QualityTools.WebTestFramework”的引用，该Dll是在.NET选项卡上 3. 在该类库项目中从WebTestPlugin派生出一个自定义的Web测试插件类 4. 重写相关的基类方法，例如 PreRequest、 PreWebTest、 PostWebTest等 5. 打开包含有Web Test的项目，并且在该项目中引用刚才添加的包含有自定义Web测试插件的类库项目 6. 打开需要调用Web测试插件的Web测试，点击&#8221;Add Web Test Plug-in&#8221;，选择刚才编写好的Web插件，完成。 以下是一个Web测试插件的实例代码，该插件重写了PreWebTest方法，所以会在Web测试执行之前运行一次。改插件的作用就是在每次运行Web测试之前，会读取一个配置文件，然后把相关的配置写到Web测试的Context中。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [...]


Related posts:<ol><li><a href='http://magustest.com/blog/automationtesting/adding-web-test-verifaction-rule/' rel='bookmark' title='Permanent Link: 自己动手创建Web测试验证规则'>自己动手创建Web测试验证规则</a></li>
<li><a href='http://magustest.com/blog/softwaretesting/using-httpcontext-in-unittest/' rel='bookmark' title='Permanent Link: 在C#单元测试中使用HttpContext的简单解决办法'>在C#单元测试中使用HttpContext的简单解决办法</a></li>
<li><a href='http://magustest.com/blog/automationtesting/data-driven-codedui-test/' rel='bookmark' title='Permanent Link: 实现数据驱动的CodedUI Test'>实现数据驱动的CodedUI Test</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>做过单元测试的朋友都知道，几乎每一个单元测试的框架都提供了类似于TestInitialize、TestCleanup这样的操作，可以在测试的开始和完成测试以后让我们处理一些问题，例如初始化一些数据，或者销毁一些数据等操作。在VSTS中有一种测试类型叫&#8221;Web测试&#8221;，它由一系列 HTTP 请求组成，通过发出 HTTP 请求在协议层工作。Web测试没有单独的TestInitialize、TestCleanup操作，但是VSTS所提供的Web Test插件能够帮助我们完成这样的工作。以下是MSDN对Web测试的定义：</p>
<blockquote><p>使用 Web 测试插件，可以隔离代码并在 Web 测试中的主要声明性语句外部重用代码。自定义的 Web 测试插件为在运行 Web 测试时调用某些代码提供了途径。在每个测试迭代中，Web 测试插件都要运行一次。此外，如果重写测试插件中的 PreRequest 或 PostRequest 方法，这些请求插件将分别在每个请求之前或之后运行。</p></blockquote>
<p>可见Web测试插件给使用者带来了很大的灵活性，下面就看看如何创建一个Web测试插件。</p>
<p>1. 创建一个新的类库项目，这个项目是一个独立的可重用的类库，所创建的Web测试插件可以在不同的包含有Web测试的项目中使用。</p>
<p>2. 在该类库项目中添加对“Microsoft.VisualStudio.QualityTools.WebTestFramework”的引用，该Dll是在.NET选项卡上</p>
<p>3. 在该类库项目中从WebTestPlugin派生出一个自定义的Web测试插件类</p>
<p>4. 重写相关的基类方法，例如 PreRequest、 PreWebTest、 PostWebTest等</p>
<p>5. 打开包含有Web Test的项目，并且在该项目中引用刚才添加的包含有自定义Web测试插件的类库项目</p>
<p>6. 打开需要调用Web测试插件的Web测试，点击&#8221;Add Web Test Plug-in&#8221;，选择刚才编写好的Web插件，完成。<br />
<span id="more-508"></span><br />
以下是一个Web测试插件的实例代码，该插件重写了PreWebTest方法，所以会在Web测试执行之前运行一次。改插件的作用就是在每次运行Web测试之前，会读取一个配置文件，然后把相关的配置写到Web测试的Context中。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> FilterRuleWebPlugin <span style="color: #008000;">:</span> Microsoft.<span style="color: #0000FF;">VisualStudio</span>.<span style="color: #0000FF;">TestTools</span>.<span style="color: #0000FF;">WebTesting</span>.<span style="color: #0000FF;">WebTestPlugin</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">static</span> <span style="color: #0600FF;">readonly</span> <span style="color: #FF0000;">string</span> key <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;RuleName&quot;</span><span style="color: #008000;">;</span>
	<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> PreWebTest<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, PreWebTestEventArgs e<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">PreWebTest</span><span style="color: #000000;">&#40;</span>sender, e<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #008080; font-style: italic;">//Add the new context</span>
		<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span>e.<span style="color: #0000FF;">WebTest</span>.<span style="color: #0000FF;">Context</span>.<span style="color: #0000FF;">ContainsKey</span><span style="color: #000000;">&#40;</span>key<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			e.<span style="color: #0000FF;">WebTest</span>.<span style="color: #0000FF;">Context</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>key, <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #FF0000;">string</span> filter <span style="color: #008000;">=</span> GetFilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>filter<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			e.<span style="color: #0000FF;">WebTest</span>.<span style="color: #0000FF;">Context</span><span style="color: #000000;">&#91;</span>key<span style="color: #000000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;default&quot;</span><span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0600FF;">else</span>
		<span style="color: #000000;">&#123;</span>
			e.<span style="color: #0000FF;">WebTest</span>.<span style="color: #0000FF;">Context</span><span style="color: #000000;">&#91;</span>key<span style="color: #000000;">&#93;</span> <span style="color: #008000;">=</span> filter<span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">private</span> <span style="color: #FF0000;">string</span> GetFilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #FF0000;">string</span> filter <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span><span style="color: #008000;">;</span>
		XmlDocument doc <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> XmlDocument<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #0600FF;">try</span>
		<span style="color: #000000;">&#123;</span>
			doc.<span style="color: #0000FF;">Load</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Config.xml&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>doc <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				filter <span style="color: #008000;">=</span> doc.<span style="color: #0000FF;">SelectSingleNode</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Settings/Filter&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">InnerText</span><span style="color: #008000;">;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span>Exception<span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0600FF;">return</span> <span style="color: #666666;">&quot;LoadFilterError&quot;</span><span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0600FF;">return</span> filter<span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>我们还可以在Web测试插件中定义一些公开的属性（Property），利用公开的属性，可以在运行Web测试之前对一些参数的输入进行指定。</p>
<p>VSTS的Web测试用起来挺方法，功能也挺强大，如果大家在使用的过程中遇到什么不爽的事情，可以尝试自己编写Web测试插件来改变那些不爽的状态。;-)Web测试插件还有很多的应用场景，今天抛砖引玉啊。</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F&amp;title=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6&amp;annotation=%E5%81%9A%E8%BF%87%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E6%9C%8B%E5%8F%8B%E9%83%BD%E7%9F%A5%E9%81%93%EF%BC%8C%E5%87%A0%E4%B9%8E%E6%AF%8F%E4%B8%80%E4%B8%AA%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E6%A1%86%E6%9E%B6%E9%83%BD%E6%8F%90%E4%BE%9B%E4%BA%86%E7%B1%BB%E4%BC%BC%E4%BA%8ETestInitialize%E3%80%81TestCleanup%E8%BF%99%E6%A0%B7%E7%9A%84%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%B5%8B%E8%AF%95%E7%9A%84%E5%BC%80%E5%A7%8B%E5%92%8C%E5%AE%8C%E6%88%90%E6%B5%8B%E8%AF%95%E4%BB%A5%E5%90%8E%E8%AE%A9%E6%88%91%E4%BB%AC%E5%A4%84%E7%90%86%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BE%8B%E5%A6%82%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%BA%9B%E6%95%B0%E6%8D%AE%EF%BC%8C%E6%88%96" title="Google Bookmarks"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F&amp;title=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6&amp;bodytext=%E5%81%9A%E8%BF%87%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E6%9C%8B%E5%8F%8B%E9%83%BD%E7%9F%A5%E9%81%93%EF%BC%8C%E5%87%A0%E4%B9%8E%E6%AF%8F%E4%B8%80%E4%B8%AA%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E6%A1%86%E6%9E%B6%E9%83%BD%E6%8F%90%E4%BE%9B%E4%BA%86%E7%B1%BB%E4%BC%BC%E4%BA%8ETestInitialize%E3%80%81TestCleanup%E8%BF%99%E6%A0%B7%E7%9A%84%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%B5%8B%E8%AF%95%E7%9A%84%E5%BC%80%E5%A7%8B%E5%92%8C%E5%AE%8C%E6%88%90%E6%B5%8B%E8%AF%95%E4%BB%A5%E5%90%8E%E8%AE%A9%E6%88%91%E4%BB%AC%E5%A4%84%E7%90%86%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BE%8B%E5%A6%82%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%BA%9B%E6%95%B0%E6%8D%AE%EF%BC%8C%E6%88%96" title="Digg"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F&amp;title=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6&amp;notes=%E5%81%9A%E8%BF%87%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E6%9C%8B%E5%8F%8B%E9%83%BD%E7%9F%A5%E9%81%93%EF%BC%8C%E5%87%A0%E4%B9%8E%E6%AF%8F%E4%B8%80%E4%B8%AA%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E6%A1%86%E6%9E%B6%E9%83%BD%E6%8F%90%E4%BE%9B%E4%BA%86%E7%B1%BB%E4%BC%BC%E4%BA%8ETestInitialize%E3%80%81TestCleanup%E8%BF%99%E6%A0%B7%E7%9A%84%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%B5%8B%E8%AF%95%E7%9A%84%E5%BC%80%E5%A7%8B%E5%92%8C%E5%AE%8C%E6%88%90%E6%B5%8B%E8%AF%95%E4%BB%A5%E5%90%8E%E8%AE%A9%E6%88%91%E4%BB%AC%E5%A4%84%E7%90%86%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BE%8B%E5%A6%82%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%BA%9B%E6%95%B0%E6%8D%AE%EF%BC%8C%E6%88%96" title="del.icio.us"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F&amp;t=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F&title=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F&title=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F&amp;title=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F&amp;title=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6&amp;body=%E5%81%9A%E8%BF%87%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E6%9C%8B%E5%8F%8B%E9%83%BD%E7%9F%A5%E9%81%93%EF%BC%8C%E5%87%A0%E4%B9%8E%E6%AF%8F%E4%B8%80%E4%B8%AA%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E6%A1%86%E6%9E%B6%E9%83%BD%E6%8F%90%E4%BE%9B%E4%BA%86%E7%B1%BB%E4%BC%BC%E4%BA%8ETestInitialize%E3%80%81TestCleanup%E8%BF%99%E6%A0%B7%E7%9A%84%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%B5%8B%E8%AF%95%E7%9A%84%E5%BC%80%E5%A7%8B%E5%92%8C%E5%AE%8C%E6%88%90%E6%B5%8B%E8%AF%95%E4%BB%A5%E5%90%8E%E8%AE%A9%E6%88%91%E4%BB%AC%E5%A4%84%E7%90%86%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BE%8B%E5%A6%82%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%BA%9B%E6%95%B0%E6%8D%AE%EF%BC%8C%E6%88%96" title="Ping.fm"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%E5%9C%A8VSTS%E4%B8%AD%E5%88%9B%E5%BB%BAWeb%20Test%E7%9A%84%E6%8F%92%E4%BB%B6%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fcreate-web-test-plugin-in-vsts%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/automationtesting/adding-web-test-verifaction-rule/' rel='bookmark' title='Permanent Link: 自己动手创建Web测试验证规则'>自己动手创建Web测试验证规则</a></li>
<li><a href='http://magustest.com/blog/softwaretesting/using-httpcontext-in-unittest/' rel='bookmark' title='Permanent Link: 在C#单元测试中使用HttpContext的简单解决办法'>在C#单元测试中使用HttpContext的简单解决办法</a></li>
<li><a href='http://magustest.com/blog/automationtesting/data-driven-codedui-test/' rel='bookmark' title='Permanent Link: 实现数据驱动的CodedUI Test'>实现数据驱动的CodedUI Test</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/automationtesting/create-web-test-plugin-in-vsts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>实现数据驱动的CodedUI Test</title>
		<link>http://magustest.com/blog/automationtesting/data-driven-codedui-test/</link>
		<comments>http://magustest.com/blog/automationtesting/data-driven-codedui-test/#comments</comments>
		<pubDate>Thu, 21 May 2009 02:37:05 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[自动化测试]]></category>
		<category><![CDATA[CodedUI Test]]></category>
		<category><![CDATA[VSTS]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=498</guid>
		<description><![CDATA[昨天介绍了如何创建一个简单的CodedUI Test。我们也知道，依靠录制回放产生的自动化测试是非常不可靠的，那些在微软的大牛们肯定也早就知道了。虽然用VSTS录制一个自动化测试脚本的过程不是那么友好，也不是很方便，不过它产生的测试代码修改起来还是比较容易的。下面我们就看看如何把一个简单的CodedUI Test改造为数据驱动脚本。 对于每一段录制的操作，VSTS都可以把它抽象成一个方法，它会把这些操作以静态方法的形式存放在一个叫RecordedMethods的类里面。可以对这些方法做任意的修改，我就把给需要输入的方法增加一个输入的参数。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 public class RecordedMethods &#123; public static void FirstClick&#40;TestContext testContext, string first&#41; &#123; //第一个输入 &#125; &#160; public static void Operation&#40;TestContext testContext, string operater&#41; &#123; //操作符 &#125; &#160; public static void [...]


Related posts:<ol><li><a href='http://magustest.com/blog/whiteboxtesting/three-different-test-fixture-setup-approach/' rel='bookmark' title='Permanent Link: 单元测试中三种准备Test Fixture的方法比较'>单元测试中三种准备Test Fixture的方法比较</a></li>
<li><a href='http://magustest.com/blog/automationtesting/create-web-test-plugin-in-vsts/' rel='bookmark' title='Permanent Link: 在VSTS中创建Web Test的插件'>在VSTS中创建Web Test的插件</a></li>
<li><a href='http://magustest.com/blog/whiteboxtesting/unit-test-pattern/' rel='bookmark' title='Permanent Link: 单元测试中的常用测试模式'>单元测试中的常用测试模式</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>昨天介绍了<a href="http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/" target="_blank">如何创建一个简单的CodedUI Test</a>。我们也知道，依靠录制回放产生的自动化测试是非常不可靠的，那些在微软的大牛们肯定也早就知道了。虽然用VSTS录制一个自动化测试脚本的过程不是那么友好，也不是很方便，不过它产生的测试代码修改起来还是比较容易的。下面我们就看看如何把一个简单的CodedUI Test改造为数据驱动脚本。</p>
<p>对于每一段录制的操作，VSTS都可以把它抽象成一个方法，它会把这些操作以静态方法的形式存放在一个叫RecordedMethods的类里面。可以对这些方法做任意的修改，我就把给需要输入的方法增加一个输入的参数。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> RecordedMethods
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> FirstClick<span style="color: #000000;">&#40;</span>TestContext testContext, <span style="color: #FF0000;">string</span> first<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-style: italic;">//第一个输入</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Operation<span style="color: #000000;">&#40;</span>TestContext testContext, <span style="color: #FF0000;">string</span> operater<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-style: italic;">//操作符</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> SecordClick<span style="color: #000000;">&#40;</span>TestContext testContext, <span style="color: #FF0000;">string</span> second<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-style: italic;">//第二个输入</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> GetResult<span style="color: #000000;">&#40;</span>TestContext testContext<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-style: italic;">//按那个等于号</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p><span id="more-498"></span></p>
<p>这些方法其实是怎么工作的呢？</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Click<span style="color: #000000;">&#40;</span>TestContext testContext, <span style="color: #FF0000;">string</span> first<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #008080; font-style: italic;">// Click '1' button</span>
	WinWindow 计算器Window <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WinWindow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008080;">#region Search Criteria</span>
	计算器Window.<span style="color: #0000FF;">SearchProperties</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Name&quot;</span>, <span style="color: #666666;">&quot;计算器&quot;</span>, <span style="color: #666666;">&quot;ClassName&quot;</span>, <span style="color: #666666;">&quot;SciCalc&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008080;">#endregion</span>
	WinWindow item1Window <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WinWindow<span style="color: #000000;">&#40;</span>计算器Window<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008080;">#region Search Criteria</span>
	item1Window.<span style="color: #0000FF;">SearchProperties</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;ControlId&quot;</span>, <span style="color: #666666;">&quot;125&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008080;">#endregion</span>
	WinButton item1Button <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WinButton<span style="color: #000000;">&#40;</span>item1Window<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008080;">#region Search Criteria</span>
	item1Button.<span style="color: #0000FF;">SearchProperties</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Name&quot;</span>, first<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008080;">#endregion</span>
	Mouse.<span style="color: #0000FF;">Click</span><span style="color: #000000;">&#40;</span>item1Button, <span style="color: #008000;">new</span> Point<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">7</span>, <span style="color: #FF0000;">12</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>首先是创建一个WinWindow对象，这个WinWindow类最终是继承自UITestControl类，这个类在Microsoft.VisualStudio.TestTools.UITesting.dll，是VSTS2010新引入的。程序首先找到计算器这个窗口，然后在计数器窗口上面找到输入的控件，然后在输入的控件上找到具体点击的按钮。这里我只需要对最后的一个搜索的条件进行参数化就可以了。</p>
<p>下面就是要准备一些数据作为输入：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; ?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;testdatas<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;first<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/first<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;operator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>+<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/operator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;last<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/last<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;expected<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/expected<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;first<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/first<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;operator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>-<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/operator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;last<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/last<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;expected<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/expected<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;first<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/first<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;operator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/operator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;last<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/last<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;expected<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>9<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/expected<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/testdatas<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>通过向该CodedUI Test添加数据源，实现简单的数据驱动。<br />
<img class="alignnone size-full wp-image-501" title="test-data" src="http://magustest.com/blog/wp-content/uploads/2009/05/test-data1.png" alt="test-data" width="540" height="476" /></p>
<p>完成后的代码如下</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> AddOperationTest<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #008080; font-style: italic;">// From the context menu, select &quot;Edit CodedUITest&quot; and choose any of options to add automation code.</span>
	RecordedMethods.<span style="color: #0000FF;">Click</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">TestContext</span>, TestContext.<span style="color: #0000FF;">DataRow</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;First&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	RecordedMethods.<span style="color: #0000FF;">Click</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">TestContext</span>, TestContext.<span style="color: #0000FF;">DataRow</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;Operator&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	RecordedMethods.<span style="color: #0000FF;">Click</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">TestContext</span>, TestContext.<span style="color: #0000FF;">DataRow</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;Last&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	RecordedMethods.<span style="color: #0000FF;">GetResult</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">TestContext</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">// Validate UIItemEdit.Text AreEqual 'xxx. '</span>
	Assert.<span style="color: #0000FF;">AreEqual</span><span style="color: #000000;">&#40;</span>TestContext.<span style="color: #0000FF;">DataRow</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;Expected&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">+</span><span style="color: #666666;">&quot;. &quot;</span>, UIMap.<span style="color: #0000FF;">UI</span>计算器Window.<span style="color: #0000FF;">UIItemWindow</span>.<span style="color: #0000FF;">UIItemEdit</span>.<span style="color: #0000FF;">Text</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>体会：VSTS自动生成的那个RecordedMethods类，里面的方法都是可以重用的，稍加修改，就能达到比较好的效果，同时也需要对这个类的方法进行清理。例如在本文中，RecordedMethods类中总共有4个方法，其中的三个方法FirstClick，Operation，SecordClick，它们其实都是一样的，就是点击计数器上的某个按钮，所以说这3个方法可以统一为一个方法Click。</p>
<p>微软一直以来所提供的傻瓜式的数据驱动的支持，很好地帮助我们实现数据驱动，有利于把测试脚本的编写与测试的设计分离。这一点如果有安装了TFS以后就能体验到，CodedUI Test可以与某个测试用例关联起来，公用数据。</p>
<p>如果大家对CodedUI Test很感兴趣，推荐大家看这个人（<a href="http://blogs.msdn.com/mathew_aniyan/default.aspx" target="_blank">Mathew Aniyan</a>）的博客，满城尽带CodedUI Test。</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F&amp;title=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test&amp;bodytext=%E6%98%A8%E5%A4%A9%E4%BB%8B%E7%BB%8D%E4%BA%86%E5%A6%82%E4%BD%95%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84CodedUI%20Test%E3%80%82%E6%88%91%E4%BB%AC%E4%B9%9F%E7%9F%A5%E9%81%93%EF%BC%8C%E4%BE%9D%E9%9D%A0%E5%BD%95%E5%88%B6%E5%9B%9E%E6%94%BE%E4%BA%A7%E7%94%9F%E7%9A%84%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E6%98%AF%E9%9D%9E%E5%B8%B8%E4%B8%8D%E5%8F%AF%E9%9D%A0%E7%9A%84%EF%BC%8C%E9%82%A3%E4%BA%9B%E5%9C%A8%E5%BE%AE%E8%BD%AF%E7%9A%84%E5%A4%A7%E7%89%9B%E4%BB%AC%E8%82%AF%E5%AE%9A%E4%B9%9F%E6%97%A9%E5%B0%B1%E7%9F%A5%E9%81%93%E4%BA%86%E3%80%82%E8%99%BD%E7%84%B6%E7%94%A8VSTS%E5%BD%95%E5%88%B6%E4%B8%80%E4%B8%AA%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E8%84%9A%E6%9C%AC%E7%9A%84%E8%BF%87%E7%A8%8B" title="Digg"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F&amp;title=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test&amp;notes=%E6%98%A8%E5%A4%A9%E4%BB%8B%E7%BB%8D%E4%BA%86%E5%A6%82%E4%BD%95%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84CodedUI%20Test%E3%80%82%E6%88%91%E4%BB%AC%E4%B9%9F%E7%9F%A5%E9%81%93%EF%BC%8C%E4%BE%9D%E9%9D%A0%E5%BD%95%E5%88%B6%E5%9B%9E%E6%94%BE%E4%BA%A7%E7%94%9F%E7%9A%84%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E6%98%AF%E9%9D%9E%E5%B8%B8%E4%B8%8D%E5%8F%AF%E9%9D%A0%E7%9A%84%EF%BC%8C%E9%82%A3%E4%BA%9B%E5%9C%A8%E5%BE%AE%E8%BD%AF%E7%9A%84%E5%A4%A7%E7%89%9B%E4%BB%AC%E8%82%AF%E5%AE%9A%E4%B9%9F%E6%97%A9%E5%B0%B1%E7%9F%A5%E9%81%93%E4%BA%86%E3%80%82%E8%99%BD%E7%84%B6%E7%94%A8VSTS%E5%BD%95%E5%88%B6%E4%B8%80%E4%B8%AA%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E8%84%9A%E6%9C%AC%E7%9A%84%E8%BF%87%E7%A8%8B" title="del.icio.us"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F&amp;t=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F&title=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F&title=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F&amp;title=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F&amp;title=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test&amp;body=%E6%98%A8%E5%A4%A9%E4%BB%8B%E7%BB%8D%E4%BA%86%E5%A6%82%E4%BD%95%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84CodedUI%20Test%E3%80%82%E6%88%91%E4%BB%AC%E4%B9%9F%E7%9F%A5%E9%81%93%EF%BC%8C%E4%BE%9D%E9%9D%A0%E5%BD%95%E5%88%B6%E5%9B%9E%E6%94%BE%E4%BA%A7%E7%94%9F%E7%9A%84%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E6%98%AF%E9%9D%9E%E5%B8%B8%E4%B8%8D%E5%8F%AF%E9%9D%A0%E7%9A%84%EF%BC%8C%E9%82%A3%E4%BA%9B%E5%9C%A8%E5%BE%AE%E8%BD%AF%E7%9A%84%E5%A4%A7%E7%89%9B%E4%BB%AC%E8%82%AF%E5%AE%9A%E4%B9%9F%E6%97%A9%E5%B0%B1%E7%9F%A5%E9%81%93%E4%BA%86%E3%80%82%E8%99%BD%E7%84%B6%E7%94%A8VSTS%E5%BD%95%E5%88%B6%E4%B8%80%E4%B8%AA%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E8%84%9A%E6%9C%AC%E7%9A%84%E8%BF%87%E7%A8%8B" title="Ping.fm"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%E5%AE%9E%E7%8E%B0%E6%95%B0%E6%8D%AE%E9%A9%B1%E5%8A%A8%E7%9A%84CodedUI%20Test%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fdata-driven-codedui-test%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/whiteboxtesting/three-different-test-fixture-setup-approach/' rel='bookmark' title='Permanent Link: 单元测试中三种准备Test Fixture的方法比较'>单元测试中三种准备Test Fixture的方法比较</a></li>
<li><a href='http://magustest.com/blog/automationtesting/create-web-test-plugin-in-vsts/' rel='bookmark' title='Permanent Link: 在VSTS中创建Web Test的插件'>在VSTS中创建Web Test的插件</a></li>
<li><a href='http://magustest.com/blog/whiteboxtesting/unit-test-pattern/' rel='bookmark' title='Permanent Link: 单元测试中的常用测试模式'>单元测试中的常用测试模式</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/automationtesting/data-driven-codedui-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VSTS 2010 Test Edition文章收集</title>
		<link>http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/</link>
		<comments>http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/#comments</comments>
		<pubDate>Thu, 21 May 2009 01:45:38 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[性能测试]]></category>
		<category><![CDATA[软件测试]]></category>
		<category><![CDATA[CodedUI Test]]></category>
		<category><![CDATA[VSTS]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=495</guid>
		<description><![CDATA[STS 2010 BETA 1在近期已经开始发布了，各路高手纷纷出动，在这里我就把我看到的一些不错的关于VSTS2010测试人员版本的文章收集一下，希望对其他人有帮助，也便于我以后复习用 文章： 《Automated User Interface Testing with Coded UI Test》VSTT官方博客出品，Coded UI Test入门 《VSTS 2010 Load Test Feature: Saving Test Logs》如何在VS的负载测试中记录日志，帮助定位问题 《VSTS 2010 Feature: Load test virtual user activity visualization》如果在用VSTS进行性能测试进行的过程中，CPU突然有一个不寻常的峰值出现，在以前是比较难找到原因的，此文给我们介绍了VSTS 2010的最新功能virtual user activity visualization 是如何帮助测试工程师找到问题的根源 《VSTS 2010 Feature: Web Test Recorder Plugins》如何在VSTS 2010中利用Web Test Recorder Plugins来做自定义的关联 《VSTS 2010: Enabling Test Impact Analysis》文章介绍了如何使用Test Impact [...]


Related posts:<ol><li><a href='http://magustest.com/blog/loadtest/vsts-load-controller-and-load-agent-installation/' rel='bookmark' title='Permanent Link: 图解微软性能测试工具VSTS2008 Load Test Agent安装'>图解微软性能测试工具VSTS2008 Load Test Agent安装</a></li>
<li><a href='http://magustest.com/blog/automationtesting/vsts2010-new-feature-codedui-test/' rel='bookmark' title='Permanent Link: VSTS2010的一个新功能&#8211;CodedUI Test简介'>VSTS2010的一个新功能&#8211;CodedUI Test简介</a></li>
<li><a href='http://magustest.com/blog/readingdaily/software-testing-note-part-sixteen/' rel='bookmark' title='Permanent Link: 《Software Testing》（软件测试）读书笔记系列 &#8211; 第十六章'>《Software Testing》（软件测试）读书笔记系列 &#8211; 第十六章</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>STS 2010 BETA 1在近期已经开始发布了，各路高手纷纷出动，在这里我就把我看到的一些不错的关于VSTS2010测试人员版本的文章收集一下，希望对其他人有帮助，也便于我以后复习用 <img src='http://magustest.com/blog/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' /> </p>
<p><strong>文章：</strong></p>
<p>《<a href="http://blogs.msdn.com/vstsqualitytools/archive/2009/06/12/automated-user-interface-testing-with-coded-ui-test.aspx" target="_blank">Automated User Interface Testing with Coded UI Test</a>》VSTT官方博客出品，Coded UI Test入门</p>
<p>《<a href="http://blogs.msdn.com/billbar/archive/2009/06/09/vsts-2010-load-test-feature-saving-test-logs.aspx" target="_blank">VSTS 2010 Load Test Feature: Saving Test Logs</a>》如何在VS的负载测试中记录日志，帮助定位问题</p>
<p>《<a href="http://blogs.msdn.com/slumley/archive/2009/06/09/vsts-2010-feature-load-test-virtual-user-activity-visualization.aspx" target="_blank">VSTS 2010 Feature: Load test virtual user activity visualization</a>》如果在用VSTS进行性能测试进行的过程中，CPU突然有一个不寻常的峰值出现，在以前是比较难找到原因的，此文给我们介绍了VSTS 2010的最新功能virtual user activity visualization 是如何帮助测试工程师找到问题的根源</p>
<p>《<a href="http://blogs.msdn.com/slumley/pages/vsts-2010-feature-web-test-recorder-plugins.aspx" target="_blank">VSTS 2010 Feature: Web Test Recorder Plugins</a>》如何在VSTS 2010中利用Web Test Recorder Plugins来做自定义的关联</p>
<p>《<a href="http://geekswithblogs.net/jakob/archive/2009/06/04/vsts-2010-enabling-test-impact-analysis.aspx" target="_blank">VSTS 2010: Enabling Test Impact Analysis</a>》文章介绍了如何使用Test Impact Analysis</p>
<p>《<a href="http://blogs.msdn.com/vstsqualitytools/archive/2009/05/29/the-evolution-of-the-ui-design-of-test-and-lab-manager.aspx" target="_blank">The Evolution of the UI Design of Test and Lab Manager</a>》一篇概要介绍 Lab Manager的文章</p>
<p>《<a href="http://msdn.microsoft.com/zh-cn/library/dd380763(en-us,VS.100).aspx" target="_blank">Quick Start Guide for Manual Testing</a>》MSDN上一篇讲述手动测试工程师如何用Lab Manager开展工作的文章</p>
<p>《<a href="http://blogs.msdn.com/jasonz/archive/2009/05/26/vs2010-tutorial-testing-tutorial-step-2.aspx" target="_blank">VS2010 Tutorial: Testing Tutorial (Step 2)</a>》文章极其详细地讲述了如何用VSTS 2010来提交一个BUG，并且展示一系列的新功能，来说明VSTS 2010如何帮助消除开发和测试之间的隔阂，减少那些不可重现的BUG。</p>
<p>《<a href="http://www.clemensreijnen.nl/post/Testing-in-the-Application-Lifecycle-with-Visual-Studio-2010-Test-Edition.aspx" target="_blank">Testing in the Application Lifecycle with Visual Studio 2010 Test Edition</a>》此文详细介绍了在VSTS2010中，测试工程师在整个应用开发生命周期中如何利用VSTS来帮助开展工作</p>
<p>《<a href="http://blogs.msdn.com/ratnaditya/archive/2009/06/01/running-automated-tests-in-manual-test-and-lab-manager-vsts-2010.aspx" target="_blank">Running automated tests in Manual Test and Lab Manager</a>》此文介绍了在Lab Manger中如何运行各种测试的方法</p>
<p>《<a href="http://blogs.msdn.com/slumley/pages/vs-2010-feature-web-test-playback-enhancements.aspx" target="_blank">VSTS 2010 Feature: Web Test Playback Enhancements</a>》文章介绍Web Test在UI方面的更新</p>
<p>《<a href="http://blogs.msdn.com/edglas/archive/2009/05/24/read-this-before-running-a-load-test-with-dev10-beta-1.aspx" target="_blank">Read this Before Running a Load Test with Dev10 Beta 1</a>》如果你的VSTS2010和2008是安装在同一台机器上，并且你又实用了VS的负载测试，那么这篇文章会告诉你如果对数据库进行设置，使得两个版本的负载测试数据能够共存互不影响</p>
<p>《<a href="http://blogs.infosupport.com/blogs/marcelv/archive/2009/05/22/how-to-enable-code-coverage-in-visual-studio-2010-unit-tests.aspx" target="_blank">How to enable code coverage in Visual Studio 2010 Unit tests</a>》，由于VSTS2010对于测试运行的一些改变，所以要打开代码覆盖率的操作与VS2008有所不同，这篇文章给我们讲述了操作细节</p>
<p>《<a href="http://blogs.msdn.com/mathew_aniyan/archive/2009/05/26/coded-ui-test-from-microsoft-test-lab-manager.aspx" target="_blank">Coded UI Test from Microsoft Test &amp; Lab Manager</a>》如何在VSTS的最新的Lab Manager中运行CodedUI Test</p>
<p>《<a href="http://blogs.msdn.com/mathew_aniyan/archive/2009/05/26/coded-ui-test-in-a-team-build.aspx" target="_blank">Coded UI Test in a Team Build</a>》这篇文章讲述了如何把一个CodedUI Test加到TEAM BUILD里面</p>
<p>《<a href="http://blogs.msdn.com/amit_chatterjee/archive/2009/05/24/the-lab-management-product-an-overview.aspx" target="_blank">The Lab Management Product – An Overview</a>》 Lab Management产品介绍。</p>
<p>《<a href="http://blogs.msdn.com/amit_chatterjee/archive/2009/05/14/official-names-for-the-2010-test-products-now-announced.aspx" target="_blank">Official Names for the 2010 Test Products now announced!</a> 》介绍了VSTS2010中，3个不同版本所包含的不同功能。</p>
<p>《<a href="http://blogs.msdn.com/slumley/pages/dev-10-feature-creating-excel-reports-for-load-test-data.aspx" target="_blank">VSTS 2010 Feature: Creating excel reports for Load Test Data</a>》，一篇介绍在VSTS2010中，如何创建一个Excel格式的性能报告的文章。</p>
<p>《<a href="http://blogs.msdn.com/edglas/archive/2009/05/24/read-this-before-running-a-load-test-with-dev10-beta-1.aspx" target="_blank">Rename load test database name before running a long test with VSTS2010 beta1</a>》，这篇文章告诉我们，如果VSTS2008和2010都安装在同一台机子上，那么在2010中运行负载测试的时候会更新数据库的schema，为了让VSTS2008的负载测试数据库和VS2010的共存，需要修改数据库的名字。</p>
<p>《<a href="http://blog.dynatrace.com/2009/05/20/how-to-extend-visual-studio-2010-web-and-load-testing-with-transactional-tracing/" target="_blank">How to extend Visual Studio 2010 Web- and Load-Testing with Transactional Tracing</a>》这篇文章讲述了如何给WEB测试做扩展。图文并茂！</p>
<p>《<a href="http://blogs.msdn.com/edglas/archive/2009/05/19/elevating-the-role-of-the-tester-with-visual-studio-2010.aspx" target="_blank">Elevating the Role of the Tester with Visual Studio 2010</a>》这篇文章详细讲述了各种各样测试工程师可以利用VSTS2010做什么样的东西，作者是VSTS测试人员版本的经理</p>
<p>《<a href="http://blogs.msdn.com/edglas/archive/2009/05/18/dev10-beta-1-available.aspx" target="_blank">Dev10 Beta 1 Available!</a>》这篇文章详细列出了VSTS2010 BETA1中，有关测试部分的更新。</p>
<p><strong>视频：</strong></p>
<p><a href="http://videos.visitmix.com/MIX09/T83M" target="_blank">Automated User Interface (UI) Testing with Microsoft Visual Studio Team System 2010</a>。一个微软的人介绍CodedUI Test，还有Test Impact，17分钟。</p>
<p><a href="http://channel9.msdn.com/shows/10-4/10-4-Episode-23-An-Introduction-to-Manual-Testing/" target="_blank">An Introduction to Manual Testing</a>。</p>
<p><strong>博客：</strong></p>
<p><a href="http://blogs.msdn.com/amit_chatterjee/default.aspx" target="_blank">Amit Chatterjee&#8217;s Blog</a>，VSTS的一个产品经理，这里经常会有关于VSTS测试部分的更新介绍</p>
<p><a href="http://blogs.msdn.com/edglas/default.aspx" target="_blank">Ed Glas&#8217;s blog on VSTS load testing</a>，也是VSTS的一个经理，他的博客主要关注Load Test和Web Test</p>
<p><a href="http://blogs.msdn.com/mathew_aniyan/" target="_blank">Mathew Aniyan&#8217;s Blog</a>，来路不明，Coded UI Test之霸！</p>
<p><a href="http://blogs.gotdotnet.com/lab_management/default.aspx" target="_blank">VSTS Lab Management team blog</a>，Lab Management官方博客</p>
<p><a href="http://blogs.msdn.com/vstsqualitytools/default.aspx" target="_blank">VS Team System Test</a>，VSTT官方博客</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F&amp;title=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86&amp;annotation=STS%202010%20BETA%201%E5%9C%A8%E8%BF%91%E6%9C%9F%E5%B7%B2%E7%BB%8F%E5%BC%80%E5%A7%8B%E5%8F%91%E5%B8%83%E4%BA%86%EF%BC%8C%E5%90%84%E8%B7%AF%E9%AB%98%E6%89%8B%E7%BA%B7%E7%BA%B7%E5%87%BA%E5%8A%A8%EF%BC%8C%E5%9C%A8%E8%BF%99%E9%87%8C%E6%88%91%E5%B0%B1%E6%8A%8A%E6%88%91%E7%9C%8B%E5%88%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E4%B8%8D%E9%94%99%E7%9A%84%E5%85%B3%E4%BA%8EVSTS2010%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E7%9A%84%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86%E4%B8%80%E4%B8%8B%EF%BC%8C%E5%B8%8C%E6%9C%9B%E5%AF%B9%E5%85%B6%E4%BB%96%E4%BA%BA%E6%9C%89%E5%B8%AE%E5%8A%A9%EF%BC%8C%E4%B9%9F%E4%BE%BF%E4%BA%8E%E6%88%91%E4%BB%A5%E5%90%8E%E5%A4%8D%E4%B9%A0%E7%94%A8%20%3Alol%3A%0A%0A%E6%96%87%E7%AB%A0%EF%BC%9A" title="Google Bookmarks"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F&amp;title=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86&amp;bodytext=STS%202010%20BETA%201%E5%9C%A8%E8%BF%91%E6%9C%9F%E5%B7%B2%E7%BB%8F%E5%BC%80%E5%A7%8B%E5%8F%91%E5%B8%83%E4%BA%86%EF%BC%8C%E5%90%84%E8%B7%AF%E9%AB%98%E6%89%8B%E7%BA%B7%E7%BA%B7%E5%87%BA%E5%8A%A8%EF%BC%8C%E5%9C%A8%E8%BF%99%E9%87%8C%E6%88%91%E5%B0%B1%E6%8A%8A%E6%88%91%E7%9C%8B%E5%88%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E4%B8%8D%E9%94%99%E7%9A%84%E5%85%B3%E4%BA%8EVSTS2010%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E7%9A%84%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86%E4%B8%80%E4%B8%8B%EF%BC%8C%E5%B8%8C%E6%9C%9B%E5%AF%B9%E5%85%B6%E4%BB%96%E4%BA%BA%E6%9C%89%E5%B8%AE%E5%8A%A9%EF%BC%8C%E4%B9%9F%E4%BE%BF%E4%BA%8E%E6%88%91%E4%BB%A5%E5%90%8E%E5%A4%8D%E4%B9%A0%E7%94%A8%20%3Alol%3A%0A%0A%E6%96%87%E7%AB%A0%EF%BC%9A" title="Digg"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F&amp;title=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86&amp;notes=STS%202010%20BETA%201%E5%9C%A8%E8%BF%91%E6%9C%9F%E5%B7%B2%E7%BB%8F%E5%BC%80%E5%A7%8B%E5%8F%91%E5%B8%83%E4%BA%86%EF%BC%8C%E5%90%84%E8%B7%AF%E9%AB%98%E6%89%8B%E7%BA%B7%E7%BA%B7%E5%87%BA%E5%8A%A8%EF%BC%8C%E5%9C%A8%E8%BF%99%E9%87%8C%E6%88%91%E5%B0%B1%E6%8A%8A%E6%88%91%E7%9C%8B%E5%88%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E4%B8%8D%E9%94%99%E7%9A%84%E5%85%B3%E4%BA%8EVSTS2010%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E7%9A%84%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86%E4%B8%80%E4%B8%8B%EF%BC%8C%E5%B8%8C%E6%9C%9B%E5%AF%B9%E5%85%B6%E4%BB%96%E4%BA%BA%E6%9C%89%E5%B8%AE%E5%8A%A9%EF%BC%8C%E4%B9%9F%E4%BE%BF%E4%BA%8E%E6%88%91%E4%BB%A5%E5%90%8E%E5%A4%8D%E4%B9%A0%E7%94%A8%20%3Alol%3A%0A%0A%E6%96%87%E7%AB%A0%EF%BC%9A" title="del.icio.us"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F&amp;t=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F&title=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F&title=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F&amp;title=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F&amp;title=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86&amp;body=STS%202010%20BETA%201%E5%9C%A8%E8%BF%91%E6%9C%9F%E5%B7%B2%E7%BB%8F%E5%BC%80%E5%A7%8B%E5%8F%91%E5%B8%83%E4%BA%86%EF%BC%8C%E5%90%84%E8%B7%AF%E9%AB%98%E6%89%8B%E7%BA%B7%E7%BA%B7%E5%87%BA%E5%8A%A8%EF%BC%8C%E5%9C%A8%E8%BF%99%E9%87%8C%E6%88%91%E5%B0%B1%E6%8A%8A%E6%88%91%E7%9C%8B%E5%88%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E4%B8%8D%E9%94%99%E7%9A%84%E5%85%B3%E4%BA%8EVSTS2010%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E7%9A%84%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86%E4%B8%80%E4%B8%8B%EF%BC%8C%E5%B8%8C%E6%9C%9B%E5%AF%B9%E5%85%B6%E4%BB%96%E4%BA%BA%E6%9C%89%E5%B8%AE%E5%8A%A9%EF%BC%8C%E4%B9%9F%E4%BE%BF%E4%BA%8E%E6%88%91%E4%BB%A5%E5%90%8E%E5%A4%8D%E4%B9%A0%E7%94%A8%20%3Alol%3A%0A%0A%E6%96%87%E7%AB%A0%EF%BC%9A" title="Ping.fm"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VSTS%202010%20Test%20Edition%E6%96%87%E7%AB%A0%E6%94%B6%E9%9B%86%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fvsts2010-test-edition-article-collection%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/loadtest/vsts-load-controller-and-load-agent-installation/' rel='bookmark' title='Permanent Link: 图解微软性能测试工具VSTS2008 Load Test Agent安装'>图解微软性能测试工具VSTS2008 Load Test Agent安装</a></li>
<li><a href='http://magustest.com/blog/automationtesting/vsts2010-new-feature-codedui-test/' rel='bookmark' title='Permanent Link: VSTS2010的一个新功能&#8211;CodedUI Test简介'>VSTS2010的一个新功能&#8211;CodedUI Test简介</a></li>
<li><a href='http://magustest.com/blog/readingdaily/software-testing-note-part-sixteen/' rel='bookmark' title='Permanent Link: 《Software Testing》（软件测试）读书笔记系列 &#8211; 第十六章'>《Software Testing》（软件测试）读书笔记系列 &#8211; 第十六章</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VSTS2010的一个新功能&#8211;CodedUI Test简介</title>
		<link>http://magustest.com/blog/automationtesting/vsts2010-new-feature-codedui-test/</link>
		<comments>http://magustest.com/blog/automationtesting/vsts2010-new-feature-codedui-test/#comments</comments>
		<pubDate>Wed, 20 May 2009 12:31:44 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[自动化测试]]></category>
		<category><![CDATA[CodedUI Test]]></category>
		<category><![CDATA[VSTS]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=478</guid>
		<description><![CDATA[VSTS2010 Beta 1 终于出来了，安装的体积不大，只有1.22GB。之前看了很多VSTS2010的新特性，尤其是测试方面的，非常期待，昨天从MSDN下下来以后，失望了一下，因为很多新功能都是基于TFS2010的，我没有装，所以很多新功能都体验不了。例如让人很激动的Lab Manager，这个需要TFS，还有支持虚拟化技术的CPU。 如果你对VSTS的测试员版本感兴趣，而又没有TFS2010，只装了VSTS2010 BETA 1，那么就只能体验一下VSTS2010的一个新功能&#8211;CodedUI Test。微软在VSTS2010以前的版本都不太重视手工测试和功能测试的支持，估计是因为Visual Studio本来是一个集成开发环境的原因吧，不过到了2010，情况完全不一样了，微软想把VS改造成为一个贯穿整个ALM（Application lifecycle management）的主要工具，所以在VSTS2010中加强了对测试计划，测试用例，相关报告等的支持，CodedUI Test就是面向功能测试工程师，给他们提供自动化测试支持的这么一个新功能。 下面我一步步演示一下怎么用CodedUI Test来对WINDOWS自带的计数器实现简单的自动化功能测试。 1. 新建一个测试项目，这个步骤与前几个版本的VS一样，就不重复累赘了。 2. 在该测试项目中新建一个CodedUI Test，如图所示 3. 当CodedUI Test被创建以后，VS会提示用户，是否立刻创建相关的自动化测试代码，如图所示： 这里会看到3个选项 Use an action recording associated with a test case or shared steps，这个选项是建立在有TFS的情况下才能实现的，因为在2010中，测试工程师可以编写测试用例，并且保存在TFS中，当有人要用CodedUI Test来实现某个测试用例的时候，就可以通过这个选项来把自动化测试和测试用例关联起来，不过可惜我没有TFS…… Use the recorder，这个选项比较常用，就是启动一个VSTS自带的录制工具来实现自动化测试，这个也是下面要详细分享的。 User the UI control Locator，这个选择会直接用VS的UI Control Locator来对被测程序的控件进行识别。本文不会详细描述。 4. 选择User the recorder，然后就会弹出一个录制的窗口，如图： 点击那个“Record Actions”就能开始录制了。VS的录制器做的挺人性化的，如果焦点不在录制器上，那么录制器就会变成透明，方便用户对被测软件的关注，下面是两个比较的图片。 选中录制器 没有选中录制器，而且在被测软件的标题栏中还有一个状态提示，表面现在录制器在工作。 [...]


Related posts:<ol><li><a href='http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/' rel='bookmark' title='Permanent Link: VSTS 2010 Test Edition文章收集'>VSTS 2010 Test Edition文章收集</a></li>
<li><a href='http://magustest.com/blog/readingdaily/software-testing-note-part-sixteen/' rel='bookmark' title='Permanent Link: 《Software Testing》（软件测试）读书笔记系列 &#8211; 第十六章'>《Software Testing》（软件测试）读书笔记系列 &#8211; 第十六章</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>VSTS2010 Beta 1 终于出来了，安装的体积不大，只有1.22GB。之前看了很多VSTS2010的新特性，尤其是测试方面的，非常期待，昨天从MSDN下下来以后，失望了一下，因为很多新功能都是基于TFS2010的，我没有装，所以很多新功能都体验不了。例如让人很激动的Lab Manager，这个需要TFS，还有支持虚拟化技术的CPU。</p>
<p>如果你对VSTS的测试员版本感兴趣，而又没有TFS2010，只装了VSTS2010 BETA 1，那么就只能体验一下VSTS2010的一个新功能&#8211;CodedUI Test。微软在VSTS2010以前的版本都不太重视手工测试和功能测试的支持，估计是因为Visual Studio本来是一个集成开发环境的原因吧，不过到了2010，情况完全不一样了，微软想把VS改造成为一个贯穿整个ALM（Application lifecycle management）的主要工具，所以在VSTS2010中加强了对测试计划，测试用例，相关报告等的支持，CodedUI Test就是面向功能测试工程师，给他们提供自动化测试支持的这么一个新功能。</p>
<p>下面我一步步演示一下怎么用CodedUI Test来对WINDOWS自带的计数器实现简单的自动化功能测试。</p>
<p><strong>1. 新建一个测试项目，这个步骤与前几个版本的VS一样，就不重复累赘了。</strong></p>
<p><strong>2. 在该测试项目中新建一个CodedUI Test，如图所示</strong></p>
<p><img class="alignnone size-full wp-image-479" title="add-coded-ui-test" src="http://magustest.com/blog/wp-content/uploads/2009/05/add-coded-ui-test1.png" alt="add-coded-ui-test" width="458" height="395" /></p>
<p><strong>3. 当CodedUI Test被创建以后，VS会提示用户，是否立刻创建相关的自动化测试代码，如图所示：</strong></p>
<p><img class="alignnone size-full wp-image-480" title="after-create-options" src="http://magustest.com/blog/wp-content/uploads/2009/05/after-create-options1.png" alt="after-create-options" width="473" height="338" /><br />
<span id="more-478"></span><br />
这里会看到3个选项</p>
<ol>
<li><strong>Use an action recording associated with a test case or shared steps</strong>，这个选项是建立在有TFS的情况下才能实现的，因为在2010中，测试工程师可以编写测试用例，并且保存在TFS中，当有人要用CodedUI Test来实现某个测试用例的时候，就可以通过这个选项来把自动化测试和测试用例关联起来，不过可惜我没有TFS……</li>
<li><strong>Use the recorder</strong>，这个选项比较常用，就是启动一个VSTS自带的录制工具来实现自动化测试，这个也是下面要详细分享的。</li>
<li><strong>User the UI control Locator</strong>，这个选择会直接用VS的UI Control Locator来对被测程序的控件进行识别。本文不会详细描述。</li>
</ol>
<p><strong>4. 选择User the recorder，</strong>然后就会弹出一个录制的窗口，如图：</p>
<p><img class="alignnone size-full wp-image-481" title="record-step" src="http://magustest.com/blog/wp-content/uploads/2009/05/record-step1.png" alt="record-step" width="445" height="435" /></p>
<p>点击那个“Record Actions”就能开始录制了。VS的录制器做的挺人性化的，如果焦点不在录制器上，那么录制器就会变成透明，方便用户对被测软件的关注，下面是两个比较的图片。</p>
<p><img class="alignnone size-full wp-image-482" title="recorder" src="http://magustest.com/blog/wp-content/uploads/2009/05/recorder1.png" alt="recorder" width="402" height="498" /></p>
<p>选中录制器</p>
<p><img class="alignnone size-full wp-image-483" title="recorder-on-top" src="http://magustest.com/blog/wp-content/uploads/2009/05/recorder-on-top1.png" alt="recorder-on-top" width="396" height="447" /></p>
<p>没有选中录制器，而且在被测软件的标题栏中还有一个状态提示，表面现在录制器在工作。</p>
<p><strong>5. 开始执行测试用例</strong>，录制器会记录下所有的步骤，如图：</p>
<p><img class="alignnone size-full wp-image-485" title="record-detail" src="http://magustest.com/blog/wp-content/uploads/2009/05/record-detail1.png" alt="record-detail" width="386" height="232" /></p>
<p>我是在计算器上进行了1+1的操作。录制器记录下了所有操作（大家可以看到是Click &#8217;1&#8242; button, Click &#8216;+&#8217; button等操作），现在把这3个操作合并成为一个方法，填入方法名，然后点击“Generate Method”，测试方法就被生成了，回到刚才的Record Actions的TAB，我们可以看到所有已经被录制的操作，如图：</p>
<p><img class="alignnone size-full wp-image-486" title="all-actions" src="http://magustest.com/blog/wp-content/uploads/2009/05/all-actions1.png" alt="all-actions" width="440" height="437" /></p>
<p>这里每一个操作，到最后对应的都是一个方法，也意味着这些操作都是可以被重用的，所以每一个Action的颗粒度大家可以自己把握，个人认为不应该做太大颗粒度的Action，首先不利于重用，其次也不利于维护。</p>
<p><strong>6. 增加检查点</strong>，对于一个自动化测试来说，自动化执行和自动化检查都是必不可少的。</p>
<p><img class="alignnone size-full wp-image-487" title="add-assertion" src="http://magustest.com/blog/wp-content/uploads/2009/05/add-assertion1.png" alt="add-assertion" width="445" height="437" /></p>
<p>现在把标签从Record Actions切换到 Add Assertions中，选中“UI Control Map”下方那个唯一可用的按钮，系统会弹出一个新的窗口，如图：</p>
<p><img class="alignnone size-full wp-image-488" title="select-control" src="http://magustest.com/blog/wp-content/uploads/2009/05/select-control1.png" alt="select-control" width="373" height="288" /></p>
<p>拖动右上角的那个十字按钮到某个控件上，这里可以把这个十字拖动到计算器的结果栏中。这时候VS识别出这是可以Edit控件，我也确定这个就是我想要对之进行验证的地方。点击ADD</p>
<p><img class="alignnone size-full wp-image-489" title="add-control" src="http://magustest.com/blog/wp-content/uploads/2009/05/add-control1.png" alt="add-control" width="371" height="287" /></p>
<p>选择了正确的控件，还需要对正确的属性进行比较。第一步是显示该控件的所有属性</p>
<p><img class="alignnone size-full wp-image-490" title="show-prop" src="http://magustest.com/blog/wp-content/uploads/2009/05/show-prop1.png" alt="show-prop" width="369" height="286" /></p>
<p>如图：</p>
<p><img class="alignnone size-full wp-image-491" title="control-property" src="http://magustest.com/blog/wp-content/uploads/2009/05/control-property1.png" alt="control-property" width="585" height="678" /></p>
<p>图中，上面的部分是公共的属性，例如类名，名称，是否激活等；下面的部分是该控件特有的属性，例如它的文字属性（Text），是否是只读的等等。我现在只需要比较Text属性是等于2.的就可以了。因为很简单，1+1=2. 完成这一步以后就能看到一个控件被添加到了UI Control Map中，里面已经记录了那些属性需要进行比较。</p>
<p><img class="alignnone size-full wp-image-492" title="control-added" src="http://magustest.com/blog/wp-content/uploads/2009/05/control-added1.png" alt="control-added" width="442" height="440" /></p>
<p><strong>7. 回放检查</strong>，浏览到刚才生成的测试，然后点进运行，我们就会看到VSTS在重复我们刚才的操作，并且对结果进行了比较，测试执行完毕。</p>
<p>至此，我们已经完成了一个简单的CodedUI Test。微软的VSTS2010提供了与其他类似的自动化功能测试软件的录制回放功能，但是与常见的功能测试自动化工具（例如QTP，微软的RFT）比较而言，VSTS2010所提供的Recordor使用起来并不是十分方便，感觉操作起来都不如其他测试工具用起来方便。不过有一点是非常值得肯定的，就是微软没有大肆宣扬他的工具能够实现录制回放功能，而解除过自动化测试的朋友都知道，用录制回放来实现自动化测试是相当地危险的，而且成功的机会也很小。这可能就是微软把VSTS2010提供的功能测试自动化的功能命名为CodedUI Test的原因吧。首先这是一种测试，其次，它还是一种针对UI的测试，而其实现是代码。这个对于以后修改和维护测试来说，是比较方便的。</p>
<p>由于没有TFS，所以没有能把自动化测试和测试用例联系起来，我个人觉得，如果单独使用CodedUI Test的话，实现自动化测试真的比较费劲（可能由于BETA,加上我在虚拟机上安装，奇慢无比），而且看不出来VSTS2010比其他商业软件或者开源解决方案有什么优势。不过我感觉如果能把CodedUI Test与测试用例管理结合起来，然后再利Lab Manager上的一些功能，一定会有不错的效果。不过Lab Manager这个东西太大太重，在中小公司估计是比较难推广的。</p>
<p>VSTS版本不断升级，慢慢地从一个纯粹的集成开发环境，过度到贯穿整个应用程序开发生命周期管理的平台了。</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F&amp;title=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B&amp;annotation=VSTS2010%20Beta%201%20%E7%BB%88%E4%BA%8E%E5%87%BA%E6%9D%A5%E4%BA%86%EF%BC%8C%E5%AE%89%E8%A3%85%E7%9A%84%E4%BD%93%E7%A7%AF%E4%B8%8D%E5%A4%A7%EF%BC%8C%E5%8F%AA%E6%9C%891.22GB%E3%80%82%E4%B9%8B%E5%89%8D%E7%9C%8B%E4%BA%86%E5%BE%88%E5%A4%9AVSTS2010%E7%9A%84%E6%96%B0%E7%89%B9%E6%80%A7%EF%BC%8C%E5%B0%A4%E5%85%B6%E6%98%AF%E6%B5%8B%E8%AF%95%E6%96%B9%E9%9D%A2%E7%9A%84%EF%BC%8C%E9%9D%9E%E5%B8%B8%E6%9C%9F%E5%BE%85%EF%BC%8C%E6%98%A8%E5%A4%A9%E4%BB%8EMSDN%E4%B8%8B%E4%B8%8B%E6%9D%A5%E4%BB%A5%E5%90%8E%EF%BC%8C%E5%A4%B1%E6%9C%9B%E4%BA%86%E4%B8%80%E4%B8%8B%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%BE%88%E5%A4%9A%E6%96%B0%E5%8A%9F%E8%83%BD%E9%83%BD%E6%98%AF%E5%9F%BA%E4%BA%8ETFS2010%E7%9A%84%EF%BC" title="Google Bookmarks"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F&amp;title=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B&amp;bodytext=VSTS2010%20Beta%201%20%E7%BB%88%E4%BA%8E%E5%87%BA%E6%9D%A5%E4%BA%86%EF%BC%8C%E5%AE%89%E8%A3%85%E7%9A%84%E4%BD%93%E7%A7%AF%E4%B8%8D%E5%A4%A7%EF%BC%8C%E5%8F%AA%E6%9C%891.22GB%E3%80%82%E4%B9%8B%E5%89%8D%E7%9C%8B%E4%BA%86%E5%BE%88%E5%A4%9AVSTS2010%E7%9A%84%E6%96%B0%E7%89%B9%E6%80%A7%EF%BC%8C%E5%B0%A4%E5%85%B6%E6%98%AF%E6%B5%8B%E8%AF%95%E6%96%B9%E9%9D%A2%E7%9A%84%EF%BC%8C%E9%9D%9E%E5%B8%B8%E6%9C%9F%E5%BE%85%EF%BC%8C%E6%98%A8%E5%A4%A9%E4%BB%8EMSDN%E4%B8%8B%E4%B8%8B%E6%9D%A5%E4%BB%A5%E5%90%8E%EF%BC%8C%E5%A4%B1%E6%9C%9B%E4%BA%86%E4%B8%80%E4%B8%8B%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%BE%88%E5%A4%9A%E6%96%B0%E5%8A%9F%E8%83%BD%E9%83%BD%E6%98%AF%E5%9F%BA%E4%BA%8ETFS2010%E7%9A%84%EF%BC" title="Digg"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F&amp;title=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B&amp;notes=VSTS2010%20Beta%201%20%E7%BB%88%E4%BA%8E%E5%87%BA%E6%9D%A5%E4%BA%86%EF%BC%8C%E5%AE%89%E8%A3%85%E7%9A%84%E4%BD%93%E7%A7%AF%E4%B8%8D%E5%A4%A7%EF%BC%8C%E5%8F%AA%E6%9C%891.22GB%E3%80%82%E4%B9%8B%E5%89%8D%E7%9C%8B%E4%BA%86%E5%BE%88%E5%A4%9AVSTS2010%E7%9A%84%E6%96%B0%E7%89%B9%E6%80%A7%EF%BC%8C%E5%B0%A4%E5%85%B6%E6%98%AF%E6%B5%8B%E8%AF%95%E6%96%B9%E9%9D%A2%E7%9A%84%EF%BC%8C%E9%9D%9E%E5%B8%B8%E6%9C%9F%E5%BE%85%EF%BC%8C%E6%98%A8%E5%A4%A9%E4%BB%8EMSDN%E4%B8%8B%E4%B8%8B%E6%9D%A5%E4%BB%A5%E5%90%8E%EF%BC%8C%E5%A4%B1%E6%9C%9B%E4%BA%86%E4%B8%80%E4%B8%8B%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%BE%88%E5%A4%9A%E6%96%B0%E5%8A%9F%E8%83%BD%E9%83%BD%E6%98%AF%E5%9F%BA%E4%BA%8ETFS2010%E7%9A%84%EF%BC" title="del.icio.us"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F&amp;t=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F&title=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F&title=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F&amp;title=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F&amp;title=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B&amp;body=VSTS2010%20Beta%201%20%E7%BB%88%E4%BA%8E%E5%87%BA%E6%9D%A5%E4%BA%86%EF%BC%8C%E5%AE%89%E8%A3%85%E7%9A%84%E4%BD%93%E7%A7%AF%E4%B8%8D%E5%A4%A7%EF%BC%8C%E5%8F%AA%E6%9C%891.22GB%E3%80%82%E4%B9%8B%E5%89%8D%E7%9C%8B%E4%BA%86%E5%BE%88%E5%A4%9AVSTS2010%E7%9A%84%E6%96%B0%E7%89%B9%E6%80%A7%EF%BC%8C%E5%B0%A4%E5%85%B6%E6%98%AF%E6%B5%8B%E8%AF%95%E6%96%B9%E9%9D%A2%E7%9A%84%EF%BC%8C%E9%9D%9E%E5%B8%B8%E6%9C%9F%E5%BE%85%EF%BC%8C%E6%98%A8%E5%A4%A9%E4%BB%8EMSDN%E4%B8%8B%E4%B8%8B%E6%9D%A5%E4%BB%A5%E5%90%8E%EF%BC%8C%E5%A4%B1%E6%9C%9B%E4%BA%86%E4%B8%80%E4%B8%8B%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%BE%88%E5%A4%9A%E6%96%B0%E5%8A%9F%E8%83%BD%E9%83%BD%E6%98%AF%E5%9F%BA%E4%BA%8ETFS2010%E7%9A%84%EF%BC" title="Ping.fm"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VSTS2010%E7%9A%84%E4%B8%80%E4%B8%AA%E6%96%B0%E5%8A%9F%E8%83%BD--CodedUI%20Test%E7%AE%80%E4%BB%8B%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Fvsts2010-new-feature-codedui-test%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/' rel='bookmark' title='Permanent Link: VSTS 2010 Test Edition文章收集'>VSTS 2010 Test Edition文章收集</a></li>
<li><a href='http://magustest.com/blog/readingdaily/software-testing-note-part-sixteen/' rel='bookmark' title='Permanent Link: 《Software Testing》（软件测试）读书笔记系列 &#8211; 第十六章'>《Software Testing》（软件测试）读书笔记系列 &#8211; 第十六章</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/automationtesting/vsts2010-new-feature-codedui-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用VSPerfMon在测试ASP.NET程序的过程中收集代码覆盖率信息</title>
		<link>http://magustest.com/blog/softwaretesting/collecting-aspnet-code-coverage-date-using-vsperfmon/</link>
		<comments>http://magustest.com/blog/softwaretesting/collecting-aspnet-code-coverage-date-using-vsperfmon/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 15:27:20 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[软件测试]]></category>
		<category><![CDATA[Profiler]]></category>
		<category><![CDATA[VSTS]]></category>
		<category><![CDATA[代码覆盖]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=454</guid>
		<description><![CDATA[前两篇文章介绍了VSTS性能分析工具Profiler和如何用Profiler发现性能问题并且进行优化。今天想分享一下如何在测试ASP.NET程序的过程中获取代码覆盖率的信息。 设想如下场景，测试人员介入到项目的需求，分析，设计的阶段，得到了很多有用的文档和信息。接下来就到了编码的阶段，在这个时候测试工程师开始根据前面获得的信息来设计测试用例，做用例评审，力求测试用例覆盖能覆盖系统的每一个角落。不幸的是，系统实在是太大，没有人能确切地知道手上的测试用例对系统的覆盖（这里指定为代码的行覆盖）能达到什么样的程度。对于系统的关键部分，没有人希望在经过几轮测试以后，还有相当部分的代码是没有被执行过的。 解决这个问题的其中一个方法，就是对关键部分的代码进行代码覆盖率的统计。平时我做单元测试和接口测试的时候，得益于IDE的帮助，代码覆盖率信息很容易就能得到，但是对于部署在IIS上的ASP.NET代码，又如何去收集代码覆盖率信息呢？曾经找过好多.NET的代码覆盖率工具，没有合适的。不过就在最近，让我发现了VSPerfMon，VSTS自带的性能数据收集工具。真是众里寻他千百度，蓦然回首，那工具却在灯火阑珊处。 1. 首先要对需要进行代码覆盖率信息收集的二进制文件(DLL, EXE)用VSInstr进行处理，记得带上/COVERAGE参数 VSInstr &#8220;D:\Websites\somewhere\bin\MySpace.Web.UserHome.dll&#8221; /COVERAGE 2. 停掉IIS iisreset /stop 3. 用VSPerfClrEnv 设置相关的环境变量 VSPerfClrEnv /globaltraceon 4. 启动VSPerfMon；参数/COVERAGE代表本次监控收集的数据是代码覆盖率；/user:&#8221;NETWORK SERVICE&#8221;，指定用户名;/CS 启用跨域会话分析；/output:&#8221;d:\magus\0422.coverage&#8221;，指定输出文件的名字和路径，记得用.coverage作为扩展名。 VSPerfMon /COVERAGE /user:&#8221;NETWORK SERVICE&#8221; /CS /output:&#8221;d:\magus\0422.coverage&#8221; 在运行完上面这条命令以后，CMD窗口就提示： Started in Stand Alone Mode Filename: d:\magus\0422.coverage 这时候需要打开一个新的CMD进行余下的操作(原来的CMD就叫CMD_A，新开的就叫CMD_B吧) 5. 停止收集代码覆盖率信息数据，因为不想让代码覆盖率信息受到影响。 VSPerfCmd /globaloff 6. 启动IIS iisreset /start 7. 对ASP.NET程序进行预热 8. 重新开启代码覆盖率信息的收集 VSPerfCmd /globalon 9. 运行测试用例，手工OR自动都可以 10. 停止代码覆盖率信息的收集 [...]


Related posts:<ol><li><a href='http://magustest.com/blog/net/intruduction-to-vsts-profile/' rel='bookmark' title='Permanent Link: VSTS性能分析工具Profiler的介绍'>VSTS性能分析工具Profiler的介绍</a></li>
<li><a href='http://magustest.com/blog/net/using-vsts-profiler-find-bottleneck-and-optimize/' rel='bookmark' title='Permanent Link: 用VSTS Profiler发现性能问题并且进行优化实例'>用VSTS Profiler发现性能问题并且进行优化实例</a></li>
<li><a href='http://magustest.com/blog/net/tips-debugging-asp-net-on-iis/' rel='bookmark' title='Permanent Link: 调试部署在IIS上的ASP.NET程序实用小技巧'>调试部署在IIS上的ASP.NET程序实用小技巧</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>前两篇文章介绍了<a href="http://magustest.com/blog/net/intruduction-to-vsts-profile/" target="_blank">VSTS性能分析工具Profiler</a>和<a href="http://magustest.com/blog/net/using-vsts-profiler-find-bottleneck-and-optimize/" target="_blank">如何用Profiler发现性能问题并且进行优化</a>。今天想分享一下如何在测试ASP.NET程序的过程中获取代码覆盖率的信息。</p>
<p>设想如下场景，测试人员介入到项目的需求，分析，设计的阶段，得到了很多有用的文档和信息。接下来就到了编码的阶段，在这个时候测试工程师开始根据前面获得的信息来设计测试用例，做用例评审，力求测试用例覆盖能覆盖系统的每一个角落。不幸的是，系统实在是太大，没有人能确切地知道手上的测试用例对系统的覆盖（这里指定为代码的行覆盖）能达到什么样的程度。对于系统的关键部分，没有人希望在经过几轮测试以后，还有相当部分的代码是没有被执行过的。</p>
<p>解决这个问题的其中一个方法，就是对关键部分的代码进行代码覆盖率的统计。平时我做单元测试和接口测试的时候，得益于IDE的帮助，代码覆盖率信息很容易就能得到，但是对于部署在IIS上的ASP.NET代码，又如何去收集代码覆盖率信息呢？曾经找过好多.NET的代码覆盖率工具，没有合适的。不过就在最近，让我发现了VSPerfMon，VSTS自带的性能数据收集工具。真是众里寻他千百度，蓦然回首，那工具却在灯火阑珊处。</p>
<p><strong>1. 首先要对需要进行代码覆盖率信息收集的二进制文件(DLL, EXE)用VSInstr进行处理，记得带上/COVERAGE参数</strong></p>
<p><em><span style="text-decoration: underline;">VSInstr &#8220;D:\Websites\somewhere\bin\MySpace.Web.UserHome.dll&#8221; /COVERAGE</span></em></p>
<p><strong>2. 停掉IIS</strong></p>
<p><em><span style="text-decoration: underline;">iisreset /stop</span></em></p>
<p><strong>3. 用VSPerfClrEnv 设置相关的环境变量</strong></p>
<p><em><span style="text-decoration: underline;">VSPerfClrEnv /globaltraceon</span></em></p>
<p><strong>4. 启动VSPerfMon；参数/COVERAGE代表本次监控收集的数据是代码覆盖率；/user:&#8221;NETWORK SERVICE&#8221;，指定用户名;/CS 启用跨域会话分析；/output:&#8221;d:\magus\0422.coverage&#8221;，指定输出文件的名字和路径，记得用.coverage作为扩展名。</strong><br />
<span id="more-454"></span><br />
<em><span style="text-decoration: underline;">VSPerfMon /COVERAGE /user:&#8221;NETWORK SERVICE&#8221; /CS /output:&#8221;d:\magus\0422.coverage&#8221;</span></em></p>
<p>在运行完上面这条命令以后，CMD窗口就提示：</p>
<blockquote><p>Started in Stand Alone Mode<br />
Filename: d:\magus\0422.coverage</p></blockquote>
<p>这时候<span style="text-decoration: underline;"><strong>需要打开一个新的CMD进行余下的操作(原来的CMD就叫CMD_A，新开的就叫CMD_B吧)</strong></span></p>
<p><strong>5. 停止</strong><strong>收集</strong><strong>代码覆盖率信息数据，因为不想让代码覆盖率信息受到影响。</strong></p>
<p><em><span style="text-decoration: underline;">VSPerfCmd /globaloff</span></em></p>
<p><strong>6. 启动IIS</strong></p>
<p><em><span style="text-decoration: underline;">iisreset /start</span></em></p>
<p><strong>7. 对ASP.NET程序进行预热</strong></p>
<p><strong>8. 重新开启代码覆盖率信息的收集</strong></p>
<p><em><span style="text-decoration: underline;">VSPerfCmd /globalon</span></em></p>
<p><strong>9. 运行测试用例，手工OR自动都可以</strong></p>
<p><strong>10. 停止代码覆盖率信息的收集</strong></p>
<p><em><span style="text-decoration: underline;">VSPerfCmd /globaloff</span></em></p>
<p><strong>11. 停止IIS</strong></p>
<p><em><span style="text-decoration: underline;">iisreset /stop</span></em></p>
<p>这时候在CMD_A中会提示“UnRegistering process (7784)”，还是保持CMD_A不动，继续操作CMD_B</p>
<p><strong>12. 结束代码覆盖率的收集，并且生成.coverage文件</strong></p>
<p><em><span style="text-decoration: underline;">VSPerfCmd /shutdown</span></em></p>
<p>这时候在原来的CMD_A中就会出现如下信息：</p>
<blockquote><p>Shutting Down Named Pipe Server<br />
Shutting Down Buffer Writer<br />
Shutting Down Process Deamon</p></blockquote>
<p>如果没有看到错误提示信息，那么本次代码覆盖率收集就应该成功了。</p>
<p><strong>13. 在VSTS IDE中打开刚才生成的.coverage查看代码覆盖率。</strong></p>
<p>如图：</p>
<p><img class="alignnone size-full wp-image-455" title="coverage" src="http://magustest.com/blog/wp-content/uploads/2009/04/coverage1.png" alt="coverage" width="610" height="212" /></p>
<p>正如以前讨论过的，<a href="http://magustest.com/blog/softwaretesting/whiteboxtesting/100-percent-statement-coverage-not-enough/" target="_blank">100%的代码覆盖率是不够的</a>，那么我们在拿到代码覆盖率数据以后，应该看一下在运行完测试用例以后以后，系统的哪些代码还没有被执行过，然后回头设计一些新的测试用例来测试那些未被测试的代码。这就要求<a href="http://magustest.com/blog/softwaretesting/do-software-tester-needs-to-know-how-to-code/" target="_blank">测试工程师要能看懂代码</a>了。</p>
<p>本文思路得益于大半年前看到这篇博客“<a href="http://www.51testing.com/?uid-13997-action-viewspace-itemid-87396" target="_blank">如何引入代码覆盖率度量提高测试质量</a>”，一直惦记于心，终于找到了适用于.NET程序的解决方法了，呵呵。</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fcollecting-aspnet-code-coverage-date-using-vsperfmon%2F&amp;t=%E7%94%A8VSPerfMon%E5%9C%A8%E6%B5%8B%E8%AF%95ASP.NET%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%87%E7%A8%8B%E4%B8%AD%E6%94%B6%E9%9B%86%E4%BB%A3%E7%A0%81%E8%A6%86%E7%9B%96%E7%8E%87%E4%BF%A1%E6%81%AF" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fcollecting-aspnet-code-coverage-date-using-vsperfmon%2F&title=%E7%94%A8VSPerfMon%E5%9C%A8%E6%B5%8B%E8%AF%95ASP.NET%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%87%E7%A8%8B%E4%B8%AD%E6%94%B6%E9%9B%86%E4%BB%A3%E7%A0%81%E8%A6%86%E7%9B%96%E7%8E%87%E4%BF%A1%E6%81%AF" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fcollecting-aspnet-code-coverage-date-using-vsperfmon%2F&title=%E7%94%A8VSPerfMon%E5%9C%A8%E6%B5%8B%E8%AF%95ASP.NET%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%87%E7%A8%8B%E4%B8%AD%E6%94%B6%E9%9B%86%E4%BB%A3%E7%A0%81%E8%A6%86%E7%9B%96%E7%8E%87%E4%BF%A1%E6%81%AF&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=%E7%94%A8VSPerfMon%E5%9C%A8%E6%B5%8B%E8%AF%95ASP.NET%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%87%E7%A8%8B%E4%B8%AD%E6%94%B6%E9%9B%86%E4%BB%A3%E7%A0%81%E8%A6%86%E7%9B%96%E7%8E%87%E4%BF%A1%E6%81%AF&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fcollecting-aspnet-code-coverage-date-using-vsperfmon%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fcollecting-aspnet-code-coverage-date-using-vsperfmon%2F&amp;title=%E7%94%A8VSPerfMon%E5%9C%A8%E6%B5%8B%E8%AF%95ASP.NET%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%87%E7%A8%8B%E4%B8%AD%E6%94%B6%E9%9B%86%E4%BB%A3%E7%A0%81%E8%A6%86%E7%9B%96%E7%8E%87%E4%BF%A1%E6%81%AF" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=%E7%94%A8VSPerfMon%E5%9C%A8%E6%B5%8B%E8%AF%95ASP.NET%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%87%E7%A8%8B%E4%B8%AD%E6%94%B6%E9%9B%86%E4%BB%A3%E7%A0%81%E8%A6%86%E7%9B%96%E7%8E%87%E4%BF%A1%E6%81%AF&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fcollecting-aspnet-code-coverage-date-using-vsperfmon%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%E7%94%A8VSPerfMon%E5%9C%A8%E6%B5%8B%E8%AF%95ASP.NET%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%87%E7%A8%8B%E4%B8%AD%E6%94%B6%E9%9B%86%E4%BB%A3%E7%A0%81%E8%A6%86%E7%9B%96%E7%8E%87%E4%BF%A1%E6%81%AF%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fcollecting-aspnet-code-coverage-date-using-vsperfmon%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/net/intruduction-to-vsts-profile/' rel='bookmark' title='Permanent Link: VSTS性能分析工具Profiler的介绍'>VSTS性能分析工具Profiler的介绍</a></li>
<li><a href='http://magustest.com/blog/net/using-vsts-profiler-find-bottleneck-and-optimize/' rel='bookmark' title='Permanent Link: 用VSTS Profiler发现性能问题并且进行优化实例'>用VSTS Profiler发现性能问题并且进行优化实例</a></li>
<li><a href='http://magustest.com/blog/net/tips-debugging-asp-net-on-iis/' rel='bookmark' title='Permanent Link: 调试部署在IIS上的ASP.NET程序实用小技巧'>调试部署在IIS上的ASP.NET程序实用小技巧</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/softwaretesting/collecting-aspnet-code-coverage-date-using-vsperfmon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>用VSTS Profiler发现性能问题并且进行优化实例</title>
		<link>http://magustest.com/blog/net/using-vsts-profiler-find-bottleneck-and-optimize/</link>
		<comments>http://magustest.com/blog/net/using-vsts-profiler-find-bottleneck-and-optimize/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 04:11:50 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[性能测试]]></category>
		<category><![CDATA[Profiler]]></category>
		<category><![CDATA[VSTS]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=439</guid>
		<description><![CDATA[上一篇文章介绍了如何使用VSTS的Profiler，今天想分享一下对于一个ASP.NET应用程序，用Profiler找到性能问题并且对之进行优化。 由于ASP.NET程序运行在一个硕大的框架上，所以一般用Sample模式收集到的数据，对发现性能问题帮助不大，以下是一个用Sample模式收集的结果： 从这个报告中我们可以看到，前5个工作量最大的函数和执行单独工作最多的函数都是系统函数。 下面看一下有针对性地用检测模式收集的数据： 本文就采用“检测”模式收集性能数据来进行分析和处理。 首先，把本次测试的目标DLL用VSInstr工具进行处理，使得Profiler能够收集相关的性能数据，这一个步骤非常关键，通常来说不需要设置额外的参数，就是默认的方式就可以了，例如：VSInstr &#8220;D:\Websites\xxxx\bin\xxxx.dll&#8221;，在处理的过程中可能会提示一些错误，具体错误的信息可以在这里查找。把相应的DLL处理完毕以后，就在命令行输入以下指令（命令行的指令用斜体加下划线表示；说明文字加黑） 停止IIS iisreset /stop 设置分析.NET应用程序所需要的环境变量，在运行完这个命令以后需要重启。由于使用检测方式进行数据采集，所以这里我用globaltraceon参数。 VSPerfClrEnv /globaltraceon 启动性能数据收集。/start:trace，告诉收集器要收集检测数据；/user:&#8221;NETWORK SERVICE&#8221; ，由于是要对IIS进行的数据进行采集，所以需要制定用户NETWORK SERVICE；/CS，启用跨进程分析，看了一些文章说是分析ASP.NET程序一般都把这个选项打开，原因不详；/output:&#8221;d:\magus\0422.vsp&#8221;，指定输出文件的路径和名称；/wincounter:&#8221;\Processor(_Total)\% Processor Time&#8221;，收集处理器的参数，这里需要注意的是，wincouter后面的性能计数器名字一定要是全名，有一个方法可以查询系统的性能计数器的全称，就是用VSTS的Server Explorer，然后找到相应的服务器(一般是本机)，下面有一个“Performance Counters”；如果要收集多个性能计数器的数据，只需要多加几个 /wincounter 参数即可，例如我在收集处理器时间的同时，还想知道Context Switcher每秒的数据。 VSPerfCmd /start:trace /user:&#8221;NETWORK SERVICE&#8221; /CS /output:&#8221;d:\magus\0422.vsp&#8221; /wincounter:&#8221;\Processor(_Total)\% Processor Time&#8221; /wincounter:&#8221;\System\Context Switches/sec&#8221; 在IIS起来之前先停止性能数据的收集 VSPerfCmd /globaloff 启动IIS iisreset /start 对程序进行预热，这一步也是很关键，因为IIS启动以后，程序需要预热才能达到稳定的状态，因为程序首次被访问的时候有些代码会被编译，所以为了降低对性能测试的影响，应该现对被测的程序进行预热。在预热完毕以后重新启动性能数据的收集。 VSPerfCmd /globalon &#8211; 运行性能测试场景 &#8211; 测试运行完毕以后，停止性能数据的收集 VSPerfCmd /globaloff 停掉IIS iisreset /stop 关闭性能数据收集器，这一步完成以后就能生成包含数据的文件了 VSPerfCmd [...]


Related posts:<ol><li><a href='http://magustest.com/blog/net/intruduction-to-vsts-profile/' rel='bookmark' title='Permanent Link: VSTS性能分析工具Profiler的介绍'>VSTS性能分析工具Profiler的介绍</a></li>
<li><a href='http://magustest.com/blog/softwaretesting/collecting-aspnet-code-coverage-date-using-vsperfmon/' rel='bookmark' title='Permanent Link: 用VSPerfMon在测试ASP.NET程序的过程中收集代码覆盖率信息'>用VSPerfMon在测试ASP.NET程序的过程中收集代码覆盖率信息</a></li>
<li><a href='http://magustest.com/blog/linux/setup-snmpd-conf/' rel='bookmark' title='Permanent Link: Linux下的snmpd.conf配置说明'>Linux下的snmpd.conf配置说明</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>上一篇文章介绍了<a href="http://magustest.com/blog/net/intruduction-to-vsts-profile/" target="_blank">如何使用VSTS的Profiler</a>，今天想分享一下对于一个ASP.NET应用程序，用Profiler找到性能问题并且对之进行优化。</p>
<p>由于ASP.NET程序运行在一个硕大的框架上，所以一般用Sample模式收集到的数据，对发现性能问题帮助不大，以下是一个用Sample模式收集的结果：</p>
<p><img class="alignnone size-full wp-image-442" title="iis-sample" src="http://magustest.com/blog/wp-content/uploads/2009/04/iis-sample1.png" alt="iis-sample" width="549" height="236" /></p>
<p>从这个报告中我们可以看到，前5个工作量最大的函数和执行单独工作最多的函数都是系统函数。</p>
<p>下面看一下有针对性地用检测模式收集的数据：</p>
<p><img class="alignnone size-full wp-image-444" title="instr-function-with-indi-work1" src="http://magustest.com/blog/wp-content/uploads/2009/04/instr-function-with-indi-work11.png" alt="instr-function-with-indi-work1" width="532" height="139" /></p>
<p>本文就采用“检测”模式收集性能数据来进行分析和处理。</p>
<p>首先，把本次测试的目标DLL用VSInstr工具进行处理，使得Profiler能够收集相关的性能数据，这一个步骤非常关键，通常来说不需要设置额外的参数，就是默认的方式就可以了，例如：VSInstr &#8220;D:\Websites\xxxx\bin\xxxx.dll&#8221;，在处理的过程中可能会提示一些错误，具体错误的信息可以在<a href="http://msdn.microsoft.com/en-us/library/ms242734.aspx" target="_blank">这里</a>查找。把相应的DLL处理完毕以后，就在命令行输入以下指令（命令行的指令用斜体加下划线表示；说明文字加黑）<br />
<span id="more-439"></span><br />
<strong>停止IIS</strong></p>
<p><span style="text-decoration: underline;"><em>iisreset /stop</em></span></p>
<p><strong>设置分析.NET应用程序所需要的环境变量，在运行完这个命令以后需要重启。由于使用检测方式进行数据采集，所以这里我用globaltraceon参数。</strong></p>
<p><span style="text-decoration: underline;"><em>VSPerfClrEnv /globaltraceon</em></span></p>
<p><strong>启动性能数据收集。<span style="text-decoration: underline;">/start:trace</span>，告诉收集器要收集检测数据；/user:&#8221;NETWORK SERVICE&#8221; ，由于是要对IIS进行的数据进行采集，所以需要制定用户NETWORK SERVICE；<span style="text-decoration: underline;">/CS</span>，启用跨进程分析，看了一些文章说是分析ASP.NET程序一般都把这个选项打开，原因不详；<span style="text-decoration: underline;">/output:&#8221;d:\magus\0422.vsp&#8221;</span>，指定输出文件的路径和名称；<span style="text-decoration: underline;">/wincounter:&#8221;\Processor(_Total)\% Processor Time&#8221;</span>，收集处理器的参数，这里需要注意的是，wincouter后面的性能计数器名字一定要是全名，有一个方法可以查询系统的性能计数器的全称，就是用VSTS的Server Explorer，然后找到相应的服务器(一般是本机)，下面有一个“Performance Counters”；如果要收集多个性能计数器的数据，只需要多加几个 /wincounter 参数即可，例如我在收集处理器时间的同时，还想知道Context Switcher每秒的数据。</strong></p>
<p><span style="text-decoration: underline;"><em>VSPerfCmd /start:trace /user:&#8221;NETWORK SERVICE&#8221; /CS /output:&#8221;d:\magus\0422.vsp&#8221; /wincounter:&#8221;\Processor(_Total)\% Processor Time&#8221; /wincounter:&#8221;\System\Context Switches/sec&#8221;</em></span></p>
<p><strong>在IIS起来之前先停止性能数据的收集</strong></p>
<p><span style="text-decoration: underline;"><em>VSPerfCmd /globaloff</em></span></p>
<p><strong>启动IIS</strong></p>
<p><em><span style="text-decoration: underline;">iisreset /start</span></em></p>
<p><strong>对程序进行预热，这一步也是很关键，因为IIS启动以后，程序需要预热才能达到稳定的状态，因为程序首次被访问的时候有些代码会被编译，所以为了降低对性能测试的影响，应该现对被测的程序进行预热。在预热完毕以后重新启动性能数据的收集。</strong></p>
<p><em><span style="text-decoration: underline;">VSPerfCmd /globalon</span></em></p>
<p><strong>&#8211; 运行性能测试场景 &#8211;<br />
</strong></p>
<p><strong>测试运行完毕以后，停止性能数据的收集</strong></p>
<p><em><span style="text-decoration: underline;">VSPerfCmd /globaloff</span></em></p>
<p><strong>停掉IIS</strong></p>
<p><em><span style="text-decoration: underline;">iisreset /stop</span></em></p>
<p><strong>关闭性能数据收集器，这一步完成以后就能生成包含数据的文件了</strong></p>
<p><em><span style="text-decoration: underline;">VSPerfCmd /shutdown</span></em></p>
<p>首先来看看收集到的报告</p>
<p><img class="alignnone size-full wp-image-447" title="time-before-opt1" src="http://magustest.com/blog/wp-content/uploads/2009/04/time-before-opt11.png" alt="time-before-opt1" width="547" height="55" /></p>
<p>在这个方法里面有一段不知名方法（其实是因为没有相应的Symbol，⊙﹏⊙b汗）占用了大量的计算时间，然后就找到相应的代码，原来该不知名方法是一个动态生成的代码，该段代码大概就是会创建一个新的Client对象，然后向另外一台服务器发起一个请求。其实不用每次调用该方法都创建一个新的Client对象。然后我尝试着把这个Client改为静态变量，经过优化以后的报告对比如下：</p>
<p><img class="alignnone size-full wp-image-448" title="time-after-opt" src="http://magustest.com/blog/wp-content/uploads/2009/04/time-after-opt1.png" alt="time-after-opt" width="523" height="251" /></p>
<p>效果还是挺明显的，但是当我重新测试一下性能的时候，被打击了一下，改动前后的性能对比相差很小，小的都可以认为是误差：P，因为在一个颇为庞大的项目中，这点小小的改动的确不可能影响大局。不过这次试验让我学会了用Profiler来找到ASP.NET运行中执行较慢的语句，并且看看这些语句有什么问题（可能是一个调用存储过程的方法很慢，而真正的原因是数据库有问题），定位问题所在，然后解决问题，最后回测一下对比改动前后的结果。看是否达到预期的优化效果。</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fusing-vsts-profiler-find-bottleneck-and-optimize%2F&amp;t=%E7%94%A8VSTS%20Profiler%E5%8F%91%E7%8E%B0%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E8%BF%9B%E8%A1%8C%E4%BC%98%E5%8C%96%E5%AE%9E%E4%BE%8B" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fusing-vsts-profiler-find-bottleneck-and-optimize%2F&title=%E7%94%A8VSTS%20Profiler%E5%8F%91%E7%8E%B0%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E8%BF%9B%E8%A1%8C%E4%BC%98%E5%8C%96%E5%AE%9E%E4%BE%8B" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fusing-vsts-profiler-find-bottleneck-and-optimize%2F&title=%E7%94%A8VSTS%20Profiler%E5%8F%91%E7%8E%B0%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E8%BF%9B%E8%A1%8C%E4%BC%98%E5%8C%96%E5%AE%9E%E4%BE%8B&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=%E7%94%A8VSTS%20Profiler%E5%8F%91%E7%8E%B0%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E8%BF%9B%E8%A1%8C%E4%BC%98%E5%8C%96%E5%AE%9E%E4%BE%8B&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fusing-vsts-profiler-find-bottleneck-and-optimize%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fusing-vsts-profiler-find-bottleneck-and-optimize%2F&amp;title=%E7%94%A8VSTS%20Profiler%E5%8F%91%E7%8E%B0%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E8%BF%9B%E8%A1%8C%E4%BC%98%E5%8C%96%E5%AE%9E%E4%BE%8B" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fusing-vsts-profiler-find-bottleneck-and-optimize%2F&amp;title=%E7%94%A8VSTS%20Profiler%E5%8F%91%E7%8E%B0%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E8%BF%9B%E8%A1%8C%E4%BC%98%E5%8C%96%E5%AE%9E%E4%BE%8B&amp;body=%E4%B8%8A%E4%B8%80%E7%AF%87%E6%96%87%E7%AB%A0%E4%BB%8B%E7%BB%8D%E4%BA%86%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8VSTS%E7%9A%84Profiler%EF%BC%8C%E4%BB%8A%E5%A4%A9%E6%83%B3%E5%88%86%E4%BA%AB%E4%B8%80%E4%B8%8B%E5%AF%B9%E4%BA%8E%E4%B8%80%E4%B8%AAASP.NET%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%EF%BC%8C%E7%94%A8Profiler%E6%89%BE%E5%88%B0%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E5%AF%B9%E4%B9%8B%E8%BF%9B%E8%A1%8C%E4%BC%98%E5%8C%96%E3%80%82%0A%0A%E7%94%B1%E4%BA%8EASP.NET%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%A1%8C%E5%9C%A8%E4%B8%80%E4%B8%AA%E7%A1%95%E5%A4%A7%E7%9A%84%E6%A1%86%E6%9E%B6%E4%B8%8A%EF%BC%8C%E6%89%80%E4%BB%A5%E4%B8%80%E8%88%AC%E7%94%A8Sample%E6%A8%A1%E5%BC%8F%E6" title="Ping.fm"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=%E7%94%A8VSTS%20Profiler%E5%8F%91%E7%8E%B0%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E8%BF%9B%E8%A1%8C%E4%BC%98%E5%8C%96%E5%AE%9E%E4%BE%8B&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fusing-vsts-profiler-find-bottleneck-and-optimize%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%E7%94%A8VSTS%20Profiler%E5%8F%91%E7%8E%B0%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98%E5%B9%B6%E4%B8%94%E8%BF%9B%E8%A1%8C%E4%BC%98%E5%8C%96%E5%AE%9E%E4%BE%8B%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fusing-vsts-profiler-find-bottleneck-and-optimize%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/net/intruduction-to-vsts-profile/' rel='bookmark' title='Permanent Link: VSTS性能分析工具Profiler的介绍'>VSTS性能分析工具Profiler的介绍</a></li>
<li><a href='http://magustest.com/blog/softwaretesting/collecting-aspnet-code-coverage-date-using-vsperfmon/' rel='bookmark' title='Permanent Link: 用VSPerfMon在测试ASP.NET程序的过程中收集代码覆盖率信息'>用VSPerfMon在测试ASP.NET程序的过程中收集代码覆盖率信息</a></li>
<li><a href='http://magustest.com/blog/linux/setup-snmpd-conf/' rel='bookmark' title='Permanent Link: Linux下的snmpd.conf配置说明'>Linux下的snmpd.conf配置说明</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/net/using-vsts-profiler-find-bottleneck-and-optimize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VSTS性能分析工具Profiler的介绍</title>
		<link>http://magustest.com/blog/net/intruduction-to-vsts-profile/</link>
		<comments>http://magustest.com/blog/net/intruduction-to-vsts-profile/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 08:41:23 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[性能测试]]></category>
		<category><![CDATA[Profiler]]></category>
		<category><![CDATA[VSTS]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=426</guid>
		<description><![CDATA[在MSDN文档中，对于VSTS中的Development Edition的介绍主要分两大块，第一是“编写高质量的代码”，第二就是“使用分析工具对应用程序性能进行分析”。在VSTS里面有一个工具，叫Profiler，这个工具可以帮助研发人员在程序运行的过程中收集相关的数据，并且对之进行分析，从而达到帮助实现性能调优的目的。本文讲述如何在使用命令行工具来对ASP.NET程序进行性能测试相关数据的收集。 在VSTS的Profiler中，有两种(VSTS2010好像有5种了)Profiling的方法，第一种是采样(Sampling)，第二种是检测(Instrumentation)。对于采样模式，它的工作原理是Profiler定期中断CPU并且收集函数的调用堆栈信息。在网上找到一个图，对于采样工作方式的描述非常清晰： 对于检测模式，他的工作原理是用VSInstr程序在原始的代码中插入一些用于计算时间的代码，例如A函数调用B函数，那么在调用B函数的前后都会被插入用于计算时间的代码，具体可以看下图： 下面我自己写了一个小的Sample类，然后把编译好的代码用Reflector来查看，很容易地就能看出区别。第一个图是没有经过VSInstr处理的原始代码： 下图就是经过VSInstr处理后，反编译后的代码： 可以看到VSInstr程序修改了原来的DLL。在检测模式下，只有经过修改后的DLL才能收集到数据。 在VSTS中，一般可以通过Analyze菜单下的Launch Performance Wizard来新建一个性能会话，然后进行性能数据的采集。 对于ASP.NET程序，可以通过以下步骤来进行“采样” iisreset /stop VSPerfClrEnv /globalsampleon VSPerfCmd /start:sample /user:&#8221;NETWORK SERVICE&#8221; /output:&#8221;d:\somewhere\xxxx.vsp&#8221; VSPerfCmd /globaloff iisreset /start VSPerfCmd /attach:xxxx VSPerfCmd /globalon &#8211;run the test scenario&#8211; VSPerfCmd /globaloff VSPerfCmd /detach iisreset /stop VSPerfCmd /shutdown 第一步是停掉IIS 然后通过VSPerfClrEnv对环境变量进行设置，具体可以查文档，做完这一步以后通常需要重启一下电脑 第三步就是通过VSPerfCmd启动性能数据收集 接下来的VSPerfCmd /globaloff就是暂停性能数据的收集 然后重启IIS，并且访问一下这个服务器上的页面，使得W3WP进程启动 查看W3WP.EXE的进程ID，然后通过VSPerfCmd /attach:xxxx把Profiler attach到IIS中 通过VSPerfCmd /globalon重新让Profiler进行性能数据的采集 然后就可以运行性能测试的场景 运行测试完毕以后就用VSPerfCmd /globaloff停止性能数据的采集 接着用VSPerfCmd [...]


Related posts:<ol><li><a href='http://magustest.com/blog/net/using-vsts-profiler-find-bottleneck-and-optimize/' rel='bookmark' title='Permanent Link: 用VSTS Profiler发现性能问题并且进行优化实例'>用VSTS Profiler发现性能问题并且进行优化实例</a></li>
<li><a href='http://magustest.com/blog/softwaretesting/collecting-aspnet-code-coverage-date-using-vsperfmon/' rel='bookmark' title='Permanent Link: 用VSPerfMon在测试ASP.NET程序的过程中收集代码覆盖率信息'>用VSPerfMon在测试ASP.NET程序的过程中收集代码覆盖率信息</a></li>
<li><a href='http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/' rel='bookmark' title='Permanent Link: VSTS 2010 Test Edition文章收集'>VSTS 2010 Test Edition文章收集</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>在<a href="http://msdn.microsoft.com/zh-cn/library/47f7hz7y.aspx" target="_blank">MSDN文档</a>中，对于VSTS中的Development Edition的介绍主要分两大块，第一是“编写高质量的代码”，第二就是“使用分析工具对应用程序性能进行分析”。在VSTS里面有一个工具，叫Profiler，这个工具可以帮助研发人员在程序运行的过程中收集相关的数据，并且对之进行分析，从而达到帮助实现性能调优的目的。本文讲述如何在使用命令行工具来对ASP.NET程序进行性能测试相关数据的收集。</p>
<p>在VSTS的Profiler中，有两种(VSTS2010好像有5种了)Profiling的方法，第一种是采样(Sampling)，第二种是检测(Instrumentation)。对于采样模式，它的工作原理是Profiler定期中断CPU并且收集函数的调用堆栈信息。在网上找到一个图，对于采样工作方式的描述非常清晰：</p>
<p><img class="alignnone size-full wp-image-429" title="how-sampling-works" src="http://magustest.com/blog/wp-content/uploads/2009/04/how-sampling-works1.jpg" alt="how-sampling-works" width="500" height="330" /></p>
<p>对于检测模式，他的工作原理是用VSInstr程序在原始的代码中插入一些用于计算时间的代码，例如A函数调用B函数，那么在调用B函数的前后都会被插入用于计算时间的代码，具体可以看下图：<br />
<span id="more-426"></span><br />
<img class="alignnone size-full wp-image-430" title="how-instr-works" src="http://magustest.com/blog/wp-content/uploads/2009/04/how-instr-works1.jpg" alt="how-instr-works" width="600" height="300" /></p>
<p>下面我自己写了一个小的Sample类，然后把编译好的代码用Reflector来查看，很容易地就能看出区别。第一个图是没有经过VSInstr处理的原始代码：</p>
<p><img class="alignnone size-full wp-image-431" title="before-instr" src="http://magustest.com/blog/wp-content/uploads/2009/04/before-instr1.png" alt="before-instr" width="351" height="274" /></p>
<p>下图就是经过VSInstr处理后，反编译后的代码：</p>
<p><img class="alignnone size-full wp-image-432" title="after-instr" src="http://magustest.com/blog/wp-content/uploads/2009/04/after-instr1.png" alt="after-instr" width="600" height="356" /></p>
<p>可以看到VSInstr程序修改了原来的DLL。在检测模式下，只有经过修改后的DLL才能收集到数据。</p>
<p>在VSTS中，一般可以通过Analyze菜单下的Launch Performance Wizard来新建一个性能会话，然后进行性能数据的采集。</p>
<p><span style="font-size: medium;"><strong>对于ASP.NET程序，可以通过以下步骤来进行“采样”</strong></span></p>
<blockquote><p>iisreset /stop<br />
VSPerfClrEnv /globalsampleon<br />
VSPerfCmd /start:sample /user:&#8221;NETWORK SERVICE&#8221; /output:&#8221;d:\somewhere\xxxx.vsp&#8221;<br />
VSPerfCmd /globaloff<br />
iisreset /start<br />
VSPerfCmd /attach:xxxx<br />
VSPerfCmd /globalon</p>
<p>&#8211;run the test scenario&#8211;</p>
<p>VSPerfCmd /globaloff<br />
VSPerfCmd /detach<br />
iisreset /stop<br />
VSPerfCmd /shutdown</p></blockquote>
<ol>
<li>第一步是停掉IIS</li>
<li>然后通过VSPerfClrEnv对环境变量进行设置，具体可以查文档，做完这一步以后通常需要重启一下电脑</li>
<li>第三步就是通过VSPerfCmd启动性能数据收集</li>
<li>接下来的VSPerfCmd /globaloff就是暂停性能数据的收集</li>
<li>然后重启IIS，并且访问一下这个服务器上的页面，使得W3WP进程启动</li>
<li>查看W3WP.EXE的进程ID，然后通过VSPerfCmd /attach:xxxx把Profiler attach到IIS中</li>
<li>通过VSPerfCmd /globalon重新让Profiler进行性能数据的采集</li>
<li>然后就可以运行性能测试的场景</li>
<li>运行测试完毕以后就用VSPerfCmd /globaloff停止性能数据的采集</li>
<li>接着用VSPerfCmd /detach让Profiler不要附着在IIS上</li>
<li>停掉IIS &#8212; iisreset /stop</li>
<li>执行VSPerfCmd /shutdown，这一步执行完毕以后，在d:\somewhere\下就有一个xxxx.vsp的性能报告。</li>
</ol>
<p><span style="font-size: medium;"><strong>对于ASP.NET程序，可以通过以下步骤来进行“检测”</strong></span></p>
<p>检测和采样其实是大同小异的，但是有一个关键的步骤就是在进行检测之前，一定要记得用VSInstr命令对需要进行检测的DLL或者EXE文件进行处理，建议一次不要检测太多文件，检测时间不要太长，因为检测所产生的数量是非常大的，产生的文件大小都是按G级别计算了。</p>
<blockquote><p>iisreset /stop<br />
VSPerfClrEnv /globaltraceon<br />
VSPerfCmd /start:trace /user:&#8221;NETWORK SERVICE&#8221; /CS /output:&#8221;d:\xxx\0422.vsp&#8221;<br />
VSPerfCmd /globaloff<br />
iisreset /start<br />
&#8211; 预热 &#8211;<br />
VSPerfCmd /globalon</p>
<p>&#8211;run code&#8211;</p>
<p>VSPerfCmd /globaloff<br />
iisreset /stop<br />
VSPerfCmd /shutdown</p></blockquote>
<p>重复一次，在做以上的步骤之前必须要用VSInstr对目标二进制文件进行处理。这里详细步骤就不做解释了，命令的主要区别就是在做检测的时候，就免去了Attach到IIS这个步骤了。</p>
<p>采样和检测，前者是宏观的性能数据采集，后者是微观的性能数据采集。对于CPU负载较高的程序，用采样会得到比较好的效果；但是如果程序运行过程中并没有消耗很多的CPU资源，那么用采样可能就不能收集到太多有用的信息。所以在不同的场景下需要应用不同的性能数据收集方法。</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F&amp;title=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D&amp;annotation=%E5%9C%A8MSDN%E6%96%87%E6%A1%A3%E4%B8%AD%EF%BC%8C%E5%AF%B9%E4%BA%8EVSTS%E4%B8%AD%E7%9A%84Development%20Edition%E7%9A%84%E4%BB%8B%E7%BB%8D%E4%B8%BB%E8%A6%81%E5%88%86%E4%B8%A4%E5%A4%A7%E5%9D%97%EF%BC%8C%E7%AC%AC%E4%B8%80%E6%98%AF%E2%80%9C%E7%BC%96%E5%86%99%E9%AB%98%E8%B4%A8%E9%87%8F%E7%9A%84%E4%BB%A3%E7%A0%81%E2%80%9D%EF%BC%8C%E7%AC%AC%E4%BA%8C%E5%B0%B1%E6%98%AF%E2%80%9C%E4%BD%BF%E7%94%A8%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7%E5%AF%B9%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E6%80%A7%E8%83%BD%E8%BF%9B%E8%A1%8C%E5%88%86%E6%9E%90%E2%80%9D%E3%80%82%E5%9C%A8VSTS%E9%87%8C%E9%9D%A2%E6%9C%89%E4%B8%80%E4%B8%AA%E5%B7%A5%E5%85%B7%EF%BC%8C%E5%8F%ABProfiler%EF%BC%8C%E8%BF%99%E4%B8%AA%E5" title="Google Bookmarks"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F&amp;title=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D&amp;bodytext=%E5%9C%A8MSDN%E6%96%87%E6%A1%A3%E4%B8%AD%EF%BC%8C%E5%AF%B9%E4%BA%8EVSTS%E4%B8%AD%E7%9A%84Development%20Edition%E7%9A%84%E4%BB%8B%E7%BB%8D%E4%B8%BB%E8%A6%81%E5%88%86%E4%B8%A4%E5%A4%A7%E5%9D%97%EF%BC%8C%E7%AC%AC%E4%B8%80%E6%98%AF%E2%80%9C%E7%BC%96%E5%86%99%E9%AB%98%E8%B4%A8%E9%87%8F%E7%9A%84%E4%BB%A3%E7%A0%81%E2%80%9D%EF%BC%8C%E7%AC%AC%E4%BA%8C%E5%B0%B1%E6%98%AF%E2%80%9C%E4%BD%BF%E7%94%A8%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7%E5%AF%B9%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E6%80%A7%E8%83%BD%E8%BF%9B%E8%A1%8C%E5%88%86%E6%9E%90%E2%80%9D%E3%80%82%E5%9C%A8VSTS%E9%87%8C%E9%9D%A2%E6%9C%89%E4%B8%80%E4%B8%AA%E5%B7%A5%E5%85%B7%EF%BC%8C%E5%8F%ABProfiler%EF%BC%8C%E8%BF%99%E4%B8%AA%E5" title="Digg"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F&amp;title=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D&amp;notes=%E5%9C%A8MSDN%E6%96%87%E6%A1%A3%E4%B8%AD%EF%BC%8C%E5%AF%B9%E4%BA%8EVSTS%E4%B8%AD%E7%9A%84Development%20Edition%E7%9A%84%E4%BB%8B%E7%BB%8D%E4%B8%BB%E8%A6%81%E5%88%86%E4%B8%A4%E5%A4%A7%E5%9D%97%EF%BC%8C%E7%AC%AC%E4%B8%80%E6%98%AF%E2%80%9C%E7%BC%96%E5%86%99%E9%AB%98%E8%B4%A8%E9%87%8F%E7%9A%84%E4%BB%A3%E7%A0%81%E2%80%9D%EF%BC%8C%E7%AC%AC%E4%BA%8C%E5%B0%B1%E6%98%AF%E2%80%9C%E4%BD%BF%E7%94%A8%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7%E5%AF%B9%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E6%80%A7%E8%83%BD%E8%BF%9B%E8%A1%8C%E5%88%86%E6%9E%90%E2%80%9D%E3%80%82%E5%9C%A8VSTS%E9%87%8C%E9%9D%A2%E6%9C%89%E4%B8%80%E4%B8%AA%E5%B7%A5%E5%85%B7%EF%BC%8C%E5%8F%ABProfiler%EF%BC%8C%E8%BF%99%E4%B8%AA%E5" title="del.icio.us"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F&amp;t=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F&title=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F&title=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F&amp;title=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F&amp;title=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D&amp;body=%E5%9C%A8MSDN%E6%96%87%E6%A1%A3%E4%B8%AD%EF%BC%8C%E5%AF%B9%E4%BA%8EVSTS%E4%B8%AD%E7%9A%84Development%20Edition%E7%9A%84%E4%BB%8B%E7%BB%8D%E4%B8%BB%E8%A6%81%E5%88%86%E4%B8%A4%E5%A4%A7%E5%9D%97%EF%BC%8C%E7%AC%AC%E4%B8%80%E6%98%AF%E2%80%9C%E7%BC%96%E5%86%99%E9%AB%98%E8%B4%A8%E9%87%8F%E7%9A%84%E4%BB%A3%E7%A0%81%E2%80%9D%EF%BC%8C%E7%AC%AC%E4%BA%8C%E5%B0%B1%E6%98%AF%E2%80%9C%E4%BD%BF%E7%94%A8%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7%E5%AF%B9%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E6%80%A7%E8%83%BD%E8%BF%9B%E8%A1%8C%E5%88%86%E6%9E%90%E2%80%9D%E3%80%82%E5%9C%A8VSTS%E9%87%8C%E9%9D%A2%E6%9C%89%E4%B8%80%E4%B8%AA%E5%B7%A5%E5%85%B7%EF%BC%8C%E5%8F%ABProfiler%EF%BC%8C%E8%BF%99%E4%B8%AA%E5" title="Ping.fm"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VSTS%E6%80%A7%E8%83%BD%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7Profiler%E7%9A%84%E4%BB%8B%E7%BB%8D%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fintruduction-to-vsts-profile%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/net/using-vsts-profiler-find-bottleneck-and-optimize/' rel='bookmark' title='Permanent Link: 用VSTS Profiler发现性能问题并且进行优化实例'>用VSTS Profiler发现性能问题并且进行优化实例</a></li>
<li><a href='http://magustest.com/blog/softwaretesting/collecting-aspnet-code-coverage-date-using-vsperfmon/' rel='bookmark' title='Permanent Link: 用VSPerfMon在测试ASP.NET程序的过程中收集代码覆盖率信息'>用VSPerfMon在测试ASP.NET程序的过程中收集代码覆盖率信息</a></li>
<li><a href='http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/' rel='bookmark' title='Permanent Link: VSTS 2010 Test Edition文章收集'>VSTS 2010 Test Edition文章收集</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/net/intruduction-to-vsts-profile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VSTS测试人员版本快速指南已经发布</title>
		<link>http://magustest.com/blog/net/vstt-quick-reference-guide-download/</link>
		<comments>http://magustest.com/blog/net/vstt-quick-reference-guide-download/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 01:43:24 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[VSTS]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=404</guid>
		<description><![CDATA[今天从VSTS LOAD TEST TEAM的一位成员的博客得知，他们今天发布了VSTS测试人员版本快速指南，我下载了浏览了一下，WEB TEST和LOAD TEST的内容讲的较多，这个指南是以问答的形式出现，个人感觉比较好。引用他们的一句原话就是“This doc is a must have for anyone working in VSTT”。可见这个分量多重。 这本指南有别于MSDN文档，这个PDF更加注重实用，主要是总结了在使用VSTT的过程中出现的问题，以及解决这些问题的方法，推荐用MSTEST的同行都下一个哦。 下载地址：VSTT Quick Reference Guide 1.0 Share and Enjoy: Related posts:VSTS 2010 Test Edition文章收集 图解微软性能测试工具VSTS2008 Load Test Agent安装


Related posts:<ol><li><a href='http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/' rel='bookmark' title='Permanent Link: VSTS 2010 Test Edition文章收集'>VSTS 2010 Test Edition文章收集</a></li>
<li><a href='http://magustest.com/blog/loadtest/vsts-load-controller-and-load-agent-installation/' rel='bookmark' title='Permanent Link: 图解微软性能测试工具VSTS2008 Load Test Agent安装'>图解微软性能测试工具VSTS2008 Load Test Agent安装</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>今天从<a href="http://blogs.msdn.com/edglas/default.aspx" target="_blank">VSTS LOAD TEST TEAM的一位成员的博客</a>得知，他们今天发布了VSTS测试人员版本快速指南，我下载了浏览了一下，WEB TEST和LOAD TEST的内容讲的较多，这个指南是以问答的形式出现，个人感觉比较好。引用他们的一句原话就是“This doc is a <span style="color: #ff0000;"><strong>must </strong></span>have for anyone working in VSTT”。可见这个分量多重。</p>
<p>这本指南有别于MSDN文档，这个PDF更加注重实用，主要是总结了在使用VSTT的过程中出现的问题，以及解决这些问题的方法，推荐用MSTEST的同行都下一个哦。</p>
<p><strong>下载地址</strong>：<a href="http://vstt2008qrg.codeplex.com/" target="_blank">VSTT Quick Reference Guide 1.0</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F&amp;title=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83&amp;bodytext=%E4%BB%8A%E5%A4%A9%E4%BB%8EVSTS%20LOAD%20TEST%20TEAM%E7%9A%84%E4%B8%80%E4%BD%8D%E6%88%90%E5%91%98%E7%9A%84%E5%8D%9A%E5%AE%A2%E5%BE%97%E7%9F%A5%EF%BC%8C%E4%BB%96%E4%BB%AC%E4%BB%8A%E5%A4%A9%E5%8F%91%E5%B8%83%E4%BA%86VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%EF%BC%8C%E6%88%91%E4%B8%8B%E8%BD%BD%E4%BA%86%E6%B5%8F%E8%A7%88%E4%BA%86%E4%B8%80%E4%B8%8B%EF%BC%8CWEB%20TEST%E5%92%8CLOAD%20TEST%E7%9A%84%E5%86%85%E5%AE%B9%E8%AE%B2%E7%9A%84%E8%BE%83%E5%A4%9A%EF%BC%8C%E8%BF%99%E4%B8%AA%E6%8C%87%E5%8D%97%E6%98%AF%E4%BB%A5%E9%97%AE%E7%AD%94%E7%9A%84%E5%BD%A2%E5%BC%8F%E5%87%BA%E7%8E%B0%EF%BC%8C%E4%B8%AA%E4%BA%BA%E6%84%9F%E8%A7%89%E6%AF%94" title="Digg"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F&amp;title=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83&amp;notes=%E4%BB%8A%E5%A4%A9%E4%BB%8EVSTS%20LOAD%20TEST%20TEAM%E7%9A%84%E4%B8%80%E4%BD%8D%E6%88%90%E5%91%98%E7%9A%84%E5%8D%9A%E5%AE%A2%E5%BE%97%E7%9F%A5%EF%BC%8C%E4%BB%96%E4%BB%AC%E4%BB%8A%E5%A4%A9%E5%8F%91%E5%B8%83%E4%BA%86VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%EF%BC%8C%E6%88%91%E4%B8%8B%E8%BD%BD%E4%BA%86%E6%B5%8F%E8%A7%88%E4%BA%86%E4%B8%80%E4%B8%8B%EF%BC%8CWEB%20TEST%E5%92%8CLOAD%20TEST%E7%9A%84%E5%86%85%E5%AE%B9%E8%AE%B2%E7%9A%84%E8%BE%83%E5%A4%9A%EF%BC%8C%E8%BF%99%E4%B8%AA%E6%8C%87%E5%8D%97%E6%98%AF%E4%BB%A5%E9%97%AE%E7%AD%94%E7%9A%84%E5%BD%A2%E5%BC%8F%E5%87%BA%E7%8E%B0%EF%BC%8C%E4%B8%AA%E4%BA%BA%E6%84%9F%E8%A7%89%E6%AF%94" title="del.icio.us"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F&amp;t=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F&title=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F&title=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F&amp;title=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F&amp;title=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83&amp;body=%E4%BB%8A%E5%A4%A9%E4%BB%8EVSTS%20LOAD%20TEST%20TEAM%E7%9A%84%E4%B8%80%E4%BD%8D%E6%88%90%E5%91%98%E7%9A%84%E5%8D%9A%E5%AE%A2%E5%BE%97%E7%9F%A5%EF%BC%8C%E4%BB%96%E4%BB%AC%E4%BB%8A%E5%A4%A9%E5%8F%91%E5%B8%83%E4%BA%86VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%EF%BC%8C%E6%88%91%E4%B8%8B%E8%BD%BD%E4%BA%86%E6%B5%8F%E8%A7%88%E4%BA%86%E4%B8%80%E4%B8%8B%EF%BC%8CWEB%20TEST%E5%92%8CLOAD%20TEST%E7%9A%84%E5%86%85%E5%AE%B9%E8%AE%B2%E7%9A%84%E8%BE%83%E5%A4%9A%EF%BC%8C%E8%BF%99%E4%B8%AA%E6%8C%87%E5%8D%97%E6%98%AF%E4%BB%A5%E9%97%AE%E7%AD%94%E7%9A%84%E5%BD%A2%E5%BC%8F%E5%87%BA%E7%8E%B0%EF%BC%8C%E4%B8%AA%E4%BA%BA%E6%84%9F%E8%A7%89%E6%AF%94" title="Ping.fm"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VSTS%E6%B5%8B%E8%AF%95%E4%BA%BA%E5%91%98%E7%89%88%E6%9C%AC%E5%BF%AB%E9%80%9F%E6%8C%87%E5%8D%97%E5%B7%B2%E7%BB%8F%E5%8F%91%E5%B8%83%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fnet%2Fvstt-quick-reference-guide-download%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/' rel='bookmark' title='Permanent Link: VSTS 2010 Test Edition文章收集'>VSTS 2010 Test Edition文章收集</a></li>
<li><a href='http://magustest.com/blog/loadtest/vsts-load-controller-and-load-agent-installation/' rel='bookmark' title='Permanent Link: 图解微软性能测试工具VSTS2008 Load Test Agent安装'>图解微软性能测试工具VSTS2008 Load Test Agent安装</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/net/vstt-quick-reference-guide-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>图解微软性能测试工具VSTS2008 Load Test Agent安装</title>
		<link>http://magustest.com/blog/loadtest/vsts-load-controller-and-load-agent-installation/</link>
		<comments>http://magustest.com/blog/loadtest/vsts-load-controller-and-load-agent-installation/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 16:18:35 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[性能测试]]></category>
		<category><![CDATA[VSTS]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=251</guid>
		<description><![CDATA[最近在用VSTS做性能测试的时候发现本地发起请求只能占用1个CPU，其余的CPU都是空闲的，上网查了一下，这个是因为用VSTS做性能测试的时候，发起压力的进程是VSTESTHost.exe，如果想让多核CPU的每一个CPU都产生压力，需要安装使用Visual Studio Team System Test Load Agent。这个工具是要钱的，即使你订阅了MSDN的什么版本，在下载中心里面下载到的都是90天试用版，可能也是因为这个原因，网上很少资料介绍如何安装和使用这个Load Agent。经过1个下午的摸索，成功配置成功，以下是在Windows Server 2003下安装Visual Studio Team System Test Load Agent的过程，VSTS，Controller和Agent都安装在同一台电脑上。 首先安装VSTS2008。 然后去微软的网站下载Visual Studio Team System Test Load Agent试用版。是一个ISO文件，用虚拟光驱挂上，然后开始安装。 如果要把Controller和Agent都安装在同一台电脑上，需要先安装Controller。安装的时候需要输入Windows的帐户和密码。整个过程不会太长，期间会默认安装SQL 2005 EXPRESS版，因为controller需要把测试的结果记录在数据库中。 安装好了controller以后，就可以安装Load Agent了，如图，也是需要输入windows的帐户和密码： 安装Agent会比安装controller多一个步骤，就是要指定controller，这里需要输入的controller的计算机名字，而不是什么LocalHost…… 如果都安装成功的话，可以在任务管理器里面找到以下3个进程：QTAgent.exe, QTAgentService.exe和QTController.exe 至此， Test Load Agent算是安装成功了，现在进入配置环节。 打开VSTS，配置Test Controller，如图： 进入配置菜单以后，需要配置： 控制器的名字：这里应该是计算机的名字，例如magusvm2003se Load Test Result Store：由于安装控制器的时候顺带安装了SQLEXPRESS，所以就用这个数据库 Agent：添加一个Agent，由于Agent也安装在一台机子上，所以就选择本机就好了。注意！状态需要为Ready才是正确的配置。 至此，Load Agent算是配置完毕了，但是还不能使用，因为当前的测试还没有配置为使用Load Agent来产生负载。 每一个测试项目，都有一个测试配置文件，现在我们就来修改这个测试配置文件吧，如图： 进入配置的窗口以后如图：需要把控制器选择为Remote，虽然其实是本地，但是从模式上来说就是Remote的。也因为只有选择Remote以后，才能选择controller，填入controller名字，这个名字是计算机的名字！！！ 到了这一步，就算是配置完成了，攻击吧，8个核心的压力机！ 最后希望大家能多讨论VSTS自带的性能测试工具，其实VSTS的LOAD TEST也是很强大的，还有推荐一篇关于如何安装Load Test Agent的文章 [...]


Related posts:<ol><li><a href='http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/' rel='bookmark' title='Permanent Link: VSTS 2010 Test Edition文章收集'>VSTS 2010 Test Edition文章收集</a></li>
<li><a href='http://magustest.com/blog/automationtesting/data-driven-codedui-test/' rel='bookmark' title='Permanent Link: 实现数据驱动的CodedUI Test'>实现数据驱动的CodedUI Test</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>最近在用VSTS做性能测试的时候发现本地发起请求只能占用1个CPU，其余的CPU都是空闲的，上网查了一下，这个是因为用VSTS做性能测试的时候，发起压力的进程是VSTESTHost.exe，如果想让多核CPU的每一个CPU都产生压力，需要安装使用Visual Studio Team System Test Load Agent。这个工具是要钱的，即使你订阅了MSDN的什么版本，在下载中心里面下载到的都是90天试用版，可能也是因为这个原因，网上很少资料介绍如何安装和使用这个Load Agent。经过1个下午的摸索，成功配置成功，以下是在Windows Server 2003下安装Visual Studio Team System Test Load Agent的过程，VSTS，Controller和Agent都安装在同一台电脑上。<br />
<span id="more-251"></span><br />
首先安装VSTS2008。</p>
<p>然后去微软的网站<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=572E1E71-AE6B-4F92-960D-544CABE62162&amp;displaylang=en" target="_blank">下载Visual Studio Team System Test Load Agent试用版</a>。是一个ISO文件，用虚拟光驱挂上，然后开始安装。</p>
<p>如果要把Controller和Agent都安装在同一台电脑上，需要先安装Controller。安装的时候需要输入Windows的帐户和密码。整个过程不会太长，期间会默认安装SQL 2005 EXPRESS版，因为controller需要把测试的结果记录在数据库中。</p>
<p><a href="http://magustest.com/blog/wp-content/uploads/2008/12/install-controller1.png"><img class="alignnone size-full wp-image-253" title="install-controller" src="http://magustest.com/blog/wp-content/uploads/2008/12/install-controller1.png" alt="" width="500" height="443" /></a></p>
<p>安装好了controller以后，就可以安装Load Agent了，如图，也是需要输入windows的帐户和密码：</p>
<p><a href="http://magustest.com/blog/wp-content/uploads/2008/12/install-agent1.png"><img class="alignnone size-full wp-image-254" title="install-agent" src="http://magustest.com/blog/wp-content/uploads/2008/12/install-agent1.png" alt="" width="500" height="451" /></a></p>
<p>安装Agent会比安装controller多一个步骤，就是要指定controller，这里需要输入的controller的计算机名字，而不是什么LocalHost……</p>
<p><a href="http://magustest.com/blog/wp-content/uploads/2008/12/install-agent-fill-in-controller-name1.png"><img class="alignnone size-full wp-image-255" title="install-agent-fill-in-controller-name" src="http://magustest.com/blog/wp-content/uploads/2008/12/install-agent-fill-in-controller-name1.png" alt="" width="500" height="448" /></a></p>
<p>如果都安装成功的话，可以在任务管理器里面找到以下3个进程：QTAgent.exe, QTAgentService.exe和QTController.exe</p>
<p><a href="http://magustest.com/blog/wp-content/uploads/2008/12/process1.png"><img class="alignnone size-full wp-image-256" title="process" src="http://magustest.com/blog/wp-content/uploads/2008/12/process1.png" alt="" width="443" height="536" /></a></p>
<p>至此， Test Load Agent算是安装成功了，现在进入配置环节。</p>
<p>打开VSTS，配置Test Controller，如图：</p>
<p><a href="http://magustest.com/blog/wp-content/uploads/2008/12/admin-controller1.png"><img class="alignnone size-full wp-image-257" title="admin-controller" src="http://magustest.com/blog/wp-content/uploads/2008/12/admin-controller1.png" alt="" width="328" height="287" /></a></p>
<p>进入配置菜单以后，需要配置：</p>
<p>控制器的名字：这里应该是计算机的名字，例如magusvm2003se</p>
<p>Load Test Result Store：由于安装控制器的时候顺带安装了SQLEXPRESS，所以就用这个数据库</p>
<p>Agent：添加一个Agent，由于Agent也安装在一台机子上，所以就选择本机就好了。注意！状态需要为Ready才是正确的配置。</p>
<p><a href="http://magustest.com/blog/wp-content/uploads/2008/12/controller11.png"><img class="alignnone size-full wp-image-261" title="controller1" src="http://magustest.com/blog/wp-content/uploads/2008/12/controller11.png" alt="" width="484" height="379" /></a></p>
<p>至此，Load Agent算是配置完毕了，但是还不能使用，因为当前的测试还没有配置为使用Load Agent来产生负载。</p>
<p>每一个测试项目，都有一个测试配置文件，现在我们就来修改这个测试配置文件吧，如图：</p>
<p><a href="http://magustest.com/blog/wp-content/uploads/2008/12/edit-config1.png"><img class="alignnone size-full wp-image-259" title="edit-config" src="http://magustest.com/blog/wp-content/uploads/2008/12/edit-config1.png" alt="" width="500" height="280" /></a></p>
<p>进入配置的窗口以后如图：需要把控制器选择为Remote，虽然其实是本地，但是从模式上来说就是Remote的。也因为只有选择Remote以后，才能选择controller，填入controller名字，这个名字是计算机的名字！！！</p>
<p><a href="http://magustest.com/blog/wp-content/uploads/2008/12/choose-controller11.png"><img class="alignnone size-full wp-image-263" title="choose-controller1" src="http://magustest.com/blog/wp-content/uploads/2008/12/choose-controller11.png" alt="" width="500" height="355" /></a></p>
<p>到了这一步，就算是配置完成了，攻击吧，8个核心的压力机！</p>
<p><a href="http://magustest.com/blog/wp-content/uploads/2008/12/cpu1.png"><img class="alignnone size-full wp-image-262" title="cpu" src="http://magustest.com/blog/wp-content/uploads/2008/12/cpu1.png" alt="" width="448" height="442" /></a></p>
<p>最后希望大家能多讨论VSTS自带的性能测试工具，其实VSTS的LOAD TEST也是很强大的，还有推荐一篇关于如何安装Load Test Agent的文章</p>
<p><a href="http://blogs.msdn.com/edglas/pages/load-agent-and-load-controller-installation-and-configuration-guide.aspx" target="_blank">http://blogs.msdn.com/edglas/pages/load-agent-and-load-controller-installation-and-configuration-guide.aspx</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Floadtest%2Fvsts-load-controller-and-load-agent-installation%2F&amp;t=%E5%9B%BE%E8%A7%A3%E5%BE%AE%E8%BD%AF%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7VSTS2008%20Load%20Test%20Agent%E5%AE%89%E8%A3%85" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Floadtest%2Fvsts-load-controller-and-load-agent-installation%2F&title=%E5%9B%BE%E8%A7%A3%E5%BE%AE%E8%BD%AF%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7VSTS2008%20Load%20Test%20Agent%E5%AE%89%E8%A3%85" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Floadtest%2Fvsts-load-controller-and-load-agent-installation%2F&title=%E5%9B%BE%E8%A7%A3%E5%BE%AE%E8%BD%AF%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7VSTS2008%20Load%20Test%20Agent%E5%AE%89%E8%A3%85&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=%E5%9B%BE%E8%A7%A3%E5%BE%AE%E8%BD%AF%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7VSTS2008%20Load%20Test%20Agent%E5%AE%89%E8%A3%85&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Floadtest%2Fvsts-load-controller-and-load-agent-installation%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Floadtest%2Fvsts-load-controller-and-load-agent-installation%2F&amp;title=%E5%9B%BE%E8%A7%A3%E5%BE%AE%E8%BD%AF%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7VSTS2008%20Load%20Test%20Agent%E5%AE%89%E8%A3%85" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=%E5%9B%BE%E8%A7%A3%E5%BE%AE%E8%BD%AF%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7VSTS2008%20Load%20Test%20Agent%E5%AE%89%E8%A3%85&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Floadtest%2Fvsts-load-controller-and-load-agent-installation%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%E5%9B%BE%E8%A7%A3%E5%BE%AE%E8%BD%AF%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7VSTS2008%20Load%20Test%20Agent%E5%AE%89%E8%A3%85%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Floadtest%2Fvsts-load-controller-and-load-agent-installation%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/softwaretesting/vsts2010-test-edition-article-collection/' rel='bookmark' title='Permanent Link: VSTS 2010 Test Edition文章收集'>VSTS 2010 Test Edition文章收集</a></li>
<li><a href='http://magustest.com/blog/automationtesting/data-driven-codedui-test/' rel='bookmark' title='Permanent Link: 实现数据驱动的CodedUI Test'>实现数据驱动的CodedUI Test</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/loadtest/vsts-load-controller-and-load-agent-installation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
