<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>geektester</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/geektester/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/geektester/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:20:43 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Importance of Testing in Envision and Planning Phase</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/importance-of-testing-in-envision-and-planning-phase</link>
      <pubDate>Wed, 22 Feb 2012 20:23:55 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2012/02/22/importance-of-testing-in-envision-and-planning-phase/</guid>
      <description><![CDATA[When you are working as a Test Consultant and if you are involved in the early phases of the...]]></description>
      <content:encoded><![CDATA[<p>When you are working as a Test Consultant and if you are involved in the early phases of the engagement, it is quite important to deliver the test artifacts on a regular basis to show measurable progress. That can help a long way to win the confidence of the customer and the stakeholders involved. Arguably, the other disciplines (<em>like developers, architects, business analysts</em>) have relatively less to do to prove their worth as they own the key artifacts like Vision scope document &amp; Functional specifications, which are perceived as the most critical ones for the success of the project. Though the test planning is an equally important activity as any other development activity of envisioning and planning phase it doesn’t get the same attention. Overall it gives a wrong impression that the testing team is not adding as much value as the development team in the initial phases of the project. I believe it is important to write a quality test plan that is not verbose but highly customized and designed, keeping in the mind the specific requirements and technology stack for the given project. It is critical for us to educate the customers by evangelizing the importance of testing in the initial phases.</p>  <p>I was in a discussion with the customers and they had this strong opinion that they are paying a lot of money for testing teams to just review requirements and write test cases. They recommended us to write automation scripts only without spending any time on designing test scenarios and test cases. I highlighted our role and contribution in requirement elicitation process to identify the gaps and save the effort upfront rather than discovering them in the build or stabilization phase. To accomplish that goal we need to spend effort in coming up with a detailed test plan and strategy that best fits the unique needs and requirements of the project in hand. We methodologically identify the areas that are best candidates for automation based on the ROI (Return on Investment) to save effort and time during the test execution phase. The quality of the automation scripts depends on the coverage of the underlying test cases / test scenarios and hence it is important to have them. At the end of the discussion I could sense that the customers were still skeptical and I didn’t expect them to get totally convinced either. I bought time and promised them to give a small demonstration of our capabilities by doing some quick POCs (Proof of Concepts).</p>  <p>From the requirements, I picked the most important ones and studied the pattern, the behavior and looked at the testability aspect of them and prepared a list of test techniques. I wanted to reduce my test cases to a number that is manageable and maintainable. I figured out that they had lot of complex process workflows where there are multiple jumps, branches and loops. I couldn’t cover them even if I wrote a whole bunch of test cases and even after doing that it will not guarantee that I didn’t miss an important path. We had the Visio's of those workflows so why not use a “<em>State Transition Table</em><s>”</s>? I came up with a quick template to represent their most complex workflow and ensured I covered at least every state and every transition once. I had added a flag to be able to filter the main flows/alternate flows. </p>  <p>Then there were a few complex business rules that had lot of conditional clauses and the result depended on the outcome of all those clauses. Again I realized that there can be lot of permutation here and I didn’t want to take chances. “<em>Decision Table</em>” just sounded right to me. I quickly prepared one covering positive and negative flows and here I had a table that was covering it all.</p>  <p>For lot of data entry forms, there were many fields and especially drop downs, radio buttons and checkboxes. I didn’t want my team to randomly pick values and tomorrow miss double-mode types of defects<s>.</s> “<em>Orthogonal array of testing</em>” can be helpful and I thought of using its Pairwise implementation to solve that problem. I used a free tool from Microsoft called <a href="http://msdn.microsoft.com/en-us/testing/bb980925">PICT</a> and voila from 72 permutations I had now arrived at just 9 permutations scientifically that ensures every pair is covered at least once.</p>  <p>After a couple of days I had put together a few running POCs of these techniques in addition to test cases that used standard techniques like EP &amp; BVA (<a href="http://en.wikipedia.org/wiki/Equivalence_partitioning">Equivalence Partitioning</a> and <a href="http://en.wikipedia.org/wiki/Boundary_value_analysis">Boundary Value Analysis</a>). I quickly came up with the best way to structure and organize my test artifacts using Microsoft Test Manager. I created a sample Requirement Traceability Matrix using Test Manager. I decided on my test suites and also defined different test configurations as the application is being targeted for multiple platforms. </p>  <p>In 3 days, we were in a conference room with all the customers and stakeholders including our project team. I ran the demos of my test techniques on the real requirements. I showed them we would ensure test coverage and provide them the requirement traceability reports using Test Manager. PICT was like magic to them. State transition tables taught them that testing is much more than randomly clicking buttons and following plain steps. Automation can be done only after you perform these key activities and test cases are not just plain word documents. </p>  <p>The meeting went well and ended with encouraging remarks like “Can you send me the link of that tool? “, “Can you share these with us for Unit testing?”, “We want you to demo this to our test team&quot;, “This sounds great”. It was evident from their response that we had their confidence. </p>  <p>Stay tuned for more post. I can be reached at <a href="mailto:rajkamal@microsoft.com">rajkamal@microsoft.com</a></p>  <p><strong>Disclaimer</strong>: This blog is my personal opinion and I apologize if it hurt your sentiments. In the words of my friend Arun (<a href="mailto:aruncha@microsoft.com">aruncha@microsoft.com</a>) , “When a<em> developer starts in a project he is already 100 miles high whereas a tester is 100 miles buried under the ground</em> and it takes the tester lot of work to reach up there and prove his value before his work is acknowledged “</p>]]></content:encoded>
    </item>
    <item>
      <title>TechNet Webcast: Automated Data Quality Checks Using SQL Server and Visual Studio (Level 300) – Raj Kamal, Microsoft</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/technet-webcast-automated-data-quality-checks-using-sql-server-and-visual-studio-level-300-raj-kamal-microsoft</link>
      <pubDate>Sat, 17 Dec 2011 22:42:40 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2011/12/17/technet-webcast-automated-data-quality-checks-using-sql-server-and-visual-studio-level-300-raj-kamal-microsoft/</guid>
      <description><![CDATA[TechNet Webcast: Automated Data Quality Checks Using SQL Server and Visual Studio (Level 300) –...]]></description>
      <content:encoded><![CDATA[<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1464.image_033C3B6E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1464.image_5F00_033C3B6E.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8880.image_thumb_0CB4F9E4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8880.image_5F00_thumb_5F00_0CB4F9E4.png" width="244" height="59" /></a></p>  <p><strong></strong></p>  <p><strong>TechNet Webcast: Automated Data Quality Checks Using SQL Server and Visual Studio (Level 300) – Raj Kamal, Microsoft</strong></p>  <p>&#160;</p>  <p>Microsoft IT's business intelligence engineering team has reduced its development and testing phases by automating the data quality audits and finding data quality issues earlier in the development cycle than in the past, using a metadata-driven, user-configurable tool. Attend this webcast to learn about automating data quality checks using Microsoft SQL Server and Microsoft Visual Studio and to hear directly from the development team how this can apply to you.   <br /><b>Presenter: </b>Raj Kamal, Microsoft IT Test Lead, Microsoft Corporation    <br />Raj Kamal is a senior test engineer who specializes in different types of testing techniques, test automation, and testability in different domains like manufacturing, healthcare, and higher education. Raj holds several certifications, including Certified Software Test Engineer (CSTE), Microsoft IT Professional for Microsoft SQL Server Business Intelligence (BI) 2008, International Software Testing Qualifications Board (ISTQB), and APICS certification in supply chain management. Raj also has expertise with Rational and Mercury testing tools, and he has helped teams develop test automation strategies and architectures for other major software companies.</p>  <p>&#160;</p>  <p><strong>Event: </strong><a title="https://msevents.microsoft.com/CUI/EventDetail.aspx?culture=en-US&amp;EventID=1032452088&amp;CountryCode=US" href="https://msevents.microsoft.com/CUI/EventDetail.aspx?culture=en-US&amp;EventID=1032452088&amp;CountryCode=US"><strong>https://msevents.microsoft.com/CUI/EventDetail.aspx?culture=en-US&amp;EventID=1032452088&amp;CountryCode=US</strong></a></p>  <p><strong>View Online: </strong><a title="https://www106.livemeeting.com/cc/MSEventsBMO/view?cn=guest&amp;id=1032452087&amp;pw=3CE735D1" href="https://www106.livemeeting.com/cc/MSEventsBMO/view?cn=guest&amp;id=1032452087&amp;pw=3CE735D1"><strong>https://www106.livemeeting.com/cc/MSEventsBMO/view?cn=guest&amp;id=1032452087&amp;pw=3CE735D1</strong></a></p>  <p>&#160;</p>  <p>Thanks,</p>  <p>Raj</p>]]></content:encoded>
    </item>
    <item>
      <title>SQL Server 2011 (Denali) Data Quality Services (DQS) – Taking Test Practices Places! (QAI STC 2011 - Published)</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/sql-server-2011-denali-data-quality-services-dqs-taking-test-practices-places-qai-stc-2011-published</link>
      <pubDate>Sat, 17 Dec 2011 22:33:18 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2011/12/17/sql-server-2011-denali-data-quality-services-dqs-taking-test-practices-places-qai-stc-2011-published/</guid>
      <description><![CDATA[If we wait until wrong decisions are made by customers relying on the bad or inaccurate data - we...]]></description>
      <content:encoded><![CDATA[<div style="text-align: left" dir="ltr" trbidi="on">   <br /><i><span style="font-size: x-small">If we wait until wrong decisions are made by customers relying on the bad or inaccurate data - we are in trouble. Data quality is often overlooked and yet there is no well-defined testing process or that provides guidance around ways to improve, maintain and monitor the data quality in any data-centric project. With the absence of any specialized testing tools that can aid in testing for data quality makes the entire situation even tougher. However the bad times are now over and with tools like upcoming SQL Server &quot;Denali&quot; Data Quality Services (DQS) we can turn the tables around. This artifact will show you how by using Denali DQS but it can be also applied on the other tools which have similar capabilities. </span></i><span style="font-size: x-small"></span>    <br /><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 11pt">Check out the link:</span>     <br />    <br /><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 11pt"><a href="http://www.qaiglobalservices.com/minisites/stc_2011/pdf/Denali_DQS.pdf" target="_blank"><span style="color: blue">http://www.qaiglobalservices.com/minisites/stc_2011/pdf/Denali_DQS.pdf</span></a></span>     <br /></div>]]></content:encoded>
    </item>
    <item>
      <title>Leveraging Microblogging for Effective Team Collaboration (QAI STC 2011)</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/leveraging-microblogging-for-effective-team-collaboration-qai-stc-2011</link>
      <pubDate>Sat, 17 Dec 2011 22:32:50 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2011/12/17/leveraging-microblogging-for-effective-team-collaboration-qai-stc-2011/</guid>
      <description><![CDATA[&#160;   Proposing the usage of Microblogging as a project communication layer on top of defect...]]></description>
      <content:encoded><![CDATA[<div style="text-align: left" dir="ltr" trbidi="on">   <div align="left">&#160;</div>   <i>Proposing the usage of Microblogging as a project communication layer on top of defect and requirement management tools like QC, primarily for Agile projects, having teams spread across geographies. Also to better help teams to include customer, stakeholders &amp; management in day-to-day project conversations and updates. </i>    <br />    <br /><em>Check out this link:</em>     <br /><i></i>    <br /><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 11pt"><a href="http://www.qaiglobalservices.com/minisites/stc_2011/pdf/Leveraging_Microblogging_for_Effective_Team_Collaboration.pdf" target="_blank"><span style="color: blue">http://www.qaiglobalservices.com/minisites/stc_2011/pdf/Leveraging_Microblogging_for_Effective_Team_Collaboration.pdf</span></a></span>     <br /></div>]]></content:encoded>
    </item>
    <item>
      <title>Agile Test Estimations using Poker Planning (QAI STC 2011 - Published)</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/agile-test-estimations-using-poker-planning-qai-stc-2011-published</link>
      <pubDate>Sat, 17 Dec 2011 22:32:00 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2011/12/17/agile-test-estimations-using-poker-planning-qai-stc-2011-published/</guid>
      <description><![CDATA[This artifact offers a template and guidelines which can be used by agile teams to commit to stories...]]></description>
      <content:encoded><![CDATA[<div style="text-align: left;" dir="ltr" trbidi="on"><br /><span style="font-size: small;">This artifact offers a template and guidelines </span><b><span style="font-family: verdana,verdana; font-size: small;"><span style="font-family: verdana,verdana; font-size: small;">which can be used by agile teams to commit to stories for a sprint </span></span></b><span style="font-family: verdana,verdana; font-size: small;"><span style="font-family: verdana,verdana; font-size: small;"></span></span><span style="font-size: small;">using the proven top-down </span><i><span style="font-family: verdana,verdana; font-size: small;"><span style="font-family: verdana,verdana; font-size: small;">"</span></span></i><span style="font-family: verdana,verdana; font-size: small;"><span style="font-family: verdana,verdana; font-size: small;"></span></span><span style="font-size: small;">Poker Planning" technique (</span><i><span style="font-family: verdana,verdana; font-size: small;"><span style="font-family: verdana,verdana; font-size: small;">for both Developers and Testing</span></span></i><span style="font-family: verdana,verdana; font-size: small;"><span style="font-family: verdana,verdana; font-size: small;"></span></span><span style="font-size: small;">) and the capacity in hand. </span> <br /> <br />
<div align="left">&nbsp;</div>
<i><span style="font-size: small;">The poker player learns that sometimes both science and common sense are wrong; that the bumblebee can fly; that, perhaps, one should never trust an expert; that there are more things in heaven and earth than are dreamt of by those with an academic bent. (David Mamet) </span></i> <br /><i><span style="font-size: small;"></span></i><span style="font-size: small;"></span>
<div style="margin-left: 0.5in;" class="MsoNormal">&nbsp;</div>
<div style="margin-left: 0.5in;" class="MsoNormal"><a href="http://www.qaiglobalservices.com/minisites/stc_2011/pdf/Agile_Test_Estimations_using_Poker_Planning.pdf">http://www.qaiglobalservices.com/minisites/stc_2011/pdf/Agile_Test_Estimations_using_Poker_Planning.pdf</a></div>
<div style="margin-left: 0.5in;" class="MsoNormal">&nbsp;</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Saga of Unsung Heroes (QAI STC 2011 - Published)</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/saga-of-unsung-heroes-qai-stc-2011-published</link>
      <pubDate>Sat, 17 Dec 2011 22:31:09 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2011/12/17/saga-of-unsung-heroes-qai-stc-2011-published/</guid>
      <description><![CDATA[This paper is written by the Testers, for the Tester. The Testers, who save millions of dollars...]]></description>
      <content:encoded><![CDATA[<div style="text-align: left" dir="ltr" trbidi="on">   <div align="left"><span style="font-size: small">This paper is written by the Testers, for the Tester. The Testers, who save millions of dollars by finding bugs, still stay unheard &amp; unsung. These are the ordinary men doing extraordinary deeds by living in a software world that poses several challenges making the „Quality‟ as a job tougher than ever. </span></div>   <span style="font-size: small"></span>    <br />    <div align="left">&#160;</div>   <i><span style="font-size: small">This paper is a tribute to all the testers in this world doing a thankless job, those who have spent long hours &amp; many years of their life with a strong belief that every bug they find makes the product better. This paper tries to address #3 major challenges of their (our) life and proposes some fresh solutions to very old problems based on our learning that can reinstate the same belief in new generations of testers </span></i>    <br /><i><span style="font-size: small"></span></i><span style="font-size: small"></span>    <br /><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: #1f497d; font-size: 11pt"><a href="http://www.qaiglobalservices.com/minisites/stc_2011/pdf/Saga_of_Unsung_Heroes.pdf" target="_blank"><span style="color: blue">http://www.qaiglobalservices.com/minisites/stc_2011/pdf/Saga_of_Unsung_Heroes.pdf</span></a></span>     <br /></div>]]></content:encoded>
    </item>
    <item>
      <title>Test Automation Guidance using VS 2010 Coded UI</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/test-automation-guidance-using-vs-2010-coded-ui</link>
      <pubDate>Sat, 10 Dec 2011 16:42:43 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2011/12/10/test-automation-guidance-using-vs-2010-coded-ui/</guid>
      <description><![CDATA[&#160;   Author:   Raj Kamal (rajkamal@microsoft.com)     &#160;  New !!! On special demand,...]]></description>
      <content:encoded><![CDATA[<p><a name="_Toc227064252"></a></p>  <p>&#160; </p>  <p><strong>Author:</strong> </p>  <p>Raj Kamal (<a href="mailto:rajkamal@microsoft.com">rajkamal@microsoft.com</a>) </p>  <h3></h3>  <h3>&#160;</h3>  <p><font style="background-color: #ffff00">New !!! On special demand, sharing the below content in PDF format as well as sample reusable Coded UI Framework for your user</font></p>  <p><a title="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/CodedUI/2086.Automation%20Guidance%20(VS%202010%20Coded%20UI)%20ExternalCommunity.pdf" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-CodedUI/2086.Automation-Guidance-_2800_VS-2010-Coded-UI_2900_-ExternalCommunity.pdf" href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-CodedUI/2086.Automation-Guidance-_2800_VS-2010-Coded-UI_2900_-ExternalCommunity.pdf">http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-CodedUI/2086.Automation-Guidance-_2800_VS-2010-Coded-UI_2900_-ExternalCommunity.pdf</a></p>  <p><a title="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/CodedUI/0167.CodedUISampleFramework.rar" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-CodedUI/0167.CodedUISampleFramework.rar" href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-CodedUI/0167.CodedUISampleFramework.rar">http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-CodedUI/0167.CodedUISampleFramework.rar</a></p>  <p>&#160;</p>  <h3><a name="_Toc293578661">Objective</a></h3>  <p>The objective of this artifact is to provide a <i>L200 test automation guidance leveraging VS 2010 Coded UI</i> <i>features </i>to foster a continuous, consistent and standard automation approach. The document can also be used as a quick jump start guide for beginners. </p>  <p>However the bigger objective is <b>Build, Deploy and Test</b> leveraging Visual Studio Lab Management features, which will allow Automation Testers to reap the benefits of the following </p>  <p>· Integrating with the build process for automatic build deployment </p>  <p>· Execution on VMs </p>  <p>· Capabilities of getting the test automation results reported as part of Test Manager (MTM) for better reporting.</p>  <p>   <table cellspacing="0" cellpadding="0"><tbody>       <tr>         <td>           <p><b>Pre-requisites:</b> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8468.clip_image001_509C0F38.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8468.clip_5F00_image001_5F00_509C0F38.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1018.clip_image001_thumb_6448F8CC.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1018.clip_5F00_image001_5F00_thumb_5F00_6448F8CC.gif" width="15" height="15" /></a> <i>Ensure you have ‘</i><b>CodedUISampleFramework’</b><i> sample Coded UI project</i> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3678.clip_image0011_4EEB4364.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3678.clip_5F00_image0011_5F00_4EEB4364.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[1]" border="0" alt="clip_image001[1]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2514.clip_image0011_thumb_63045FED.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2514.clip_5F00_image0011_5F00_thumb_5F00_63045FED.gif" width="15" height="15" /></a> <i>For VS 2010 installation &amp; Configuration, go to </i><a href="file:///D:/raj/raj backup/VS 2010/Automation Guidance MGSI/Review/Automation Guidance/#_Pre-Requisites:_Installation_and"><i>Appendix: VS 2010 Installation Reference section</i></a><i> </i></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4274.clip_image0012_4DA6AA85.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4274.clip_5F00_image0012_5F00_4DA6AA85.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[2]" border="0" alt="clip_image001[2]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6724.clip_image0012_thumb_61BFC70E.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6724.clip_5F00_image0012_5F00_thumb_5F00_61BFC70E.gif" width="15" height="15" /></a> <i>If you are new to Visual Studio Coded UI, go to </i><a href="file:///D:/raj/raj backup/VS 2010/Automation Guidance MGSI/Review/Automation Guidance/#_Getting_Started"><i>Appendix: Getting started with VS2010</i></a> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8484.clip_image0013_7A4F645E.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8484.clip_5F00_image0013_5F00_7A4F645E.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[3]" border="0" alt="clip_image001[3]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1031.clip_image0013_thumb_4B89ABBC.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1031.clip_5F00_image0013_5F00_thumb_5F00_4B89ABBC.gif" width="15" height="15" /></a> <i>Ensure your application is supported by Coded UI, go to </i><a href="http://msdn.microsoft.com/en-us/library/dd380742.aspx"><i>MSDN link</i></a><i> </i></p>         </td>       </tr>     </tbody></table> </p> <i></i>  <p><i></i></p>  <p><i></i></p>  <p><i></i></p>  <p><i></i></p>  <p><a name="_Toc284684660"></a><a name="_Case_Study"></a>Jump to Case Study, if your objective is to get started with Coded UI using our recommended framework and practices. </p>  <p>&#160; </p>  <h3><a name="_Toc293578662">Test Automation Process using Visual Studio 2010</a></h3>  <p>It is not enough just to automate your tests but there is also an important need to automate the build process as well as automatic installation and deployment. This will eliminate manual intervention required to trigger the automation due to build and deployment dependencies. </p>  <p>Automated Build, Deploy and Test framework will also enable us to find out the build quality at the earliest by publishing the test results for every run against a new build. </p>  <p>You can run the test suites that are most important for your continuous builds because too many tests can delay the completion of build. Make sure that you run these tests for the current iteration. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7750.image_5FA2C845.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7750.image_5F00_5FA2C845.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4532.image_thumb_2F782B2A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4532.image_5F00_thumb_5F00_2F782B2A.png" width="677" height="565" /></a> </p>  <p>Figure 1: The topology required for setting up Build, Deploy and Test environment using various VS components like Build Controller and Agents for Build, Test Controller and Agent for distributing test and collecting results, Virtual environment for Deployment and Execution (Reference taken from <a href="http://msdn.microsoft.com/en-us/library/fda2bad5.aspx">MSDN</a>) </p>  <p>To run unit or functional automation tests, we can create a set of environments that are managed Hyper-V images in Microsoft Test Manager. Tests that are created at the start can be used as part of continuous integration. </p>  <p>1. For Daily build, we want to run very minimal set of test which are like Build Verification test or Smoke test </p>  <p>2. For Weekly builds, we want to run “Regression test” which will be more in number. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3554.image_1704C575.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3554.image_5F00_1704C575.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5127.image_thumb_62F02621.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5127.image_5F00_thumb_5F00_62F02621.png" width="759" height="427" /></a> </p>  <p>Figure 2: Steps for Build, Deploy and Test workflow </p>  <p>If you plan to run your automated tests by using Microsoft Test Manager, you must use a physical or virtual environment that contains a set of roles to run your tests from your test plan. </p>  <p><i>**Build, Deploy and Test using Visual Studio Lab Management will be demonstrated using the below case study in future editions of this document</i><i>.</i> </p>  <p>We will now learn Coded UI automation features as well as our recommended automation framework and best practices in rest of the document. </p>  <p>&#160; </p>  <h3><a name="_Toc293578663">Case Study: Coded UI Automation</a></h3>  <table cellspacing="0" cellpadding="0"><tbody>     <tr>       <td>         <p><b></b>&#160; </p>          <p><b>Case Study </b></p>          <p>You have been given the task to test the basic functionality of Microsoft Bing <a href="http://www.bing.com">www.bing.com</a> and automation is in scope. You know that Microsoft Visual Studio Coded UI can be used to automate your functional tests. We assume that you have already written your functional test using MTM</p>       </td>     </tr>   </tbody></table>  <p>We are going provide guidance on Coded UI automation using a real world case study. We assume you are familiar with Microsoft Test Manager for writing test cases (<i>otherwise please jump to Get started section in Appendix</i>) </p>  <p><i></i></p>  <p><i></i></p>  <p><i></i></p>  <p>Here is a sample snapshot of your test cases in MTM: </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2500.image_5E49F59A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2500.image_5F00_5E49F59A.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1460.image_thumb_72336263.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1460.image_5F00_thumb_5F00_72336263.png" width="821" height="343" /></a> </p>  <p>In subsequent sections, we will present the various approaches and steps involved in <b>Automation Development Lifecycle</b> that you should take to achieve your objective while following the automation standards and guidelines that are recommended. </p>  <h4>&#160;</h4>  <h4><a name="_Toc293578664"><font color="#000000" size="4" face="Arial">Step 1: Automation Planning</font></a></h4>  <p>Like Project Planning or Test Planning, Automation planning is equally important to ensure that the teams are not directly jumping into automation scripting without taking all the important factors into consideration which are extremely critical for providing accurate estimates, deciding the right framework, choosing the right approach, the long term maintenance of automation and getting early ROI (Return on Investment). </p>  <p>This activity will be primarily focused on identifying the feasibility and the scope of automation. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6237.image_2CDABFA0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6237.image_5F00_2CDABFA0.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5582.image_thumb_4BB1337E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5582.image_5F00_thumb_5F00_4BB1337E.png" width="705" height="353" /></a> </p>  <p>Figure 3: Steps involved in Automation Scope and Planning </p>  <p>Taking our case study, we will walk you through each of these steps below: </p>  <h5></h5>  <h5><a name="_Toc293578665">a) Identify Automatable Test Cases, Scenarios &amp; plan Order of Execution</a></h5>  <p>We must clearly know beforehand the test cases that are good automation candidates, the scenarios that can be converted into library methods for reuse and the sequence of execution if the tests are dependent on each other.    <table border="1" cellspacing="0" cellpadding="0" width="747"><tbody>       <tr>         <td valign="top" width="36">           <p>SL No.</p>         </td>          <td valign="top" width="188">           <p>Checklist</p>         </td>          <td valign="top" width="308">           <p>Description</p>         </td>          <td valign="top" width="213">           <p>Y/N </p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>1.</p>         </td>          <td valign="top" width="188">           <p>Have you identified and marked the automatable tests as PLANNED in Test Manager?</p>         </td>          <td valign="top" width="308">           <p>Open your test cases in Test Manager that you want to automate and mark Automation Status = “Planned” for those </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2867.image_5F9AA047.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2867.image_5F00_5F9AA047.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7563.image_thumb_7751D7AD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7563.image_5F00_thumb_5F00_7751D7AD.png" width="489" height="314" /></a> </p>            <p><i>For the case study, we have marked the automation candidate as “Planned” as shown below. </i></p>            <p><i></i></p>            <p><i>Whereas the test which are not good candidates for automation are marked as “Not Automated” to show that they are out-of-scope for automation.</i></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3343.image_24C2D1A4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3343.image_5F00_24C2D1A4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8640.image_thumb_6203866B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8640.image_5F00_thumb_5F00_6203866B.png" width="544" height="323" /></a></p>         </td>          <td valign="top" width="213">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>2.</p>         </td>          <td valign="top" width="188">           <p>Have you identified your data-driven test cases?</p>         </td>          <td valign="top" width="308">           <p>Identify your test cases that are data-driven (<i>this will be required during automation design)</i> </p>            <p><i>For our case study, look at the example of one data-driven test related to Bing where you want to perform search multiple times for the list of values provided as Test data</i></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3301.image_3D7ECC5C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3301.image_5F00_3D7ECC5C.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7510.image_thumb_024AF091.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7510.image_5F00_thumb_5F00_024AF091.png" width="399" height="503" /></a></p>         </td>          <td valign="top" width="213">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>3.</p>         </td>          <td valign="top" width="188">           <p>Have you identified the common functionalities/scenarios OR SHARED STEPS which can be automated for Reusability?</p>         </td>          <td valign="top" width="308">           <p>Ensure that you identify the Shared Steps or Common functionalities that can be later be converted into methods inside your application specific libraries to reduce automation effort and redundancy </p>            <p><i>For the case study, here is one of the examples of Shared step or common functionality which can be added to the automation library.</i> </p>            <p><i></i></p>            <p><i>Note: This will be used during automation design </i></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4786.image_349E9E43.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4786.image_5F00_349E9E43.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4382.image_thumb_709ABA2B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4382.image_5F00_thumb_5F00_709ABA2B.png" width="381" height="509" /></a></p>         </td>          <td valign="top" width="213">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>4. </p>         </td>          <td valign="top" width="188">           <p>Have you identified the precedence / sequence of execution for your automated tests?</p>         </td>          <td valign="top" width="308">           <p>&#160; </p>            <p>Ensure that you mark the sequence / precedence for the automated tests that have to be run </p>            <p>As shown below, define the order of execution for your automaton scripts using OrderID field</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6866.image_7EC90D4E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6866.image_5F00_7EC90D4E.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4341.image_thumb_05B89A07.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4341.image_5F00_thumb_5F00_05B89A07.png" width="531" height="384" /></a></p>         </td>          <td valign="top" width="213">           <p><b>☐</b><b></b></p>         </td>       </tr>     </tbody></table> </p>  <h5><a name="_Toc293578666">b) POC (Proof of Concept)</a></h5>  <p>Now that we know the scope, we must also ensure that the application or technology in hand is actually supported by VS Coded UI Test by doing a POC on key scenarios. Many a times there might be custom controls and other components that are not automatable / supported by Coded UI out-of-the-box or need customization or are not worth automating due to low ROI. The outcome of this activity should help you decide your approach and next steps. You may mark the non-automatable test cases as out-of-scope for automation.    <table border="1" cellspacing="0" cellpadding="0" width="752"><tbody>       <tr>         <td valign="top" width="66">           <p>SL No.</p>         </td>          <td valign="top" width="636">           <p>Checklist</p>         </td>          <td valign="top" width="48">           <p>Yes/No </p>         </td>       </tr>        <tr>         <td valign="top" width="66">           <p>1.</p>         </td>          <td valign="top" width="636">           <p>Have you done a feasibility study to ensure VS 2010 Coded UI supports your application? </p>            <p>Identify key scenarios of your application and ensure that they are supported by VS 2010 Coded UI by coding few scripts and checking the results.</p>         </td>          <td valign="top" width="48">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="66">           <p>2.</p>         </td>          <td valign="top" width="636">           <p>Does your application have 3rd party controls or custom controls? </p>            <p>Ensure that you call out the tests which are not supported by VS 2010 as “out-of-scope” for automation. </p>         </td>          <td valign="top" width="48">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="66">           <p>3.</p>         </td>          <td valign="top" width="636">           <p>Testability: Have you worked with the development team to ensure that the properties of the objects are exposed and set appropriately for smooth automation? </p>            <p>It is extremely important to work with the development team to work on the testability right from the design phase to make automation easier later in the cycle. </p>         </td>          <td valign="top" width="48">           <p><b>☐</b><b></b></p>         </td>       </tr>     </tbody></table> </p>  <h5><a name="_Toc284684662"></a></h5>  <h5><a name="_Toc293578667">c) Automation Estimation</a></h5>  <p>The estimation will decide the success or failure of your automation project as it has been observed that automation can take much more time than anticipated if all the key tasks involved in automation lifecycle development are not clearly thought of while estimating. </p>  <p>The following major activities in each phase of automation must be estimated. </p>  <p>Automation Initiation </p>  <p>· Tool/Framework Feasibility Study </p>  <p>· POC </p>  <p>Framework Design/Implement </p>  <p>· Design and Implement Various Framework Components </p>  <p>· Testing the Framework Components and End to End Testing </p>  <p>· Training Resources on the Framework/Tool </p>  <p>· Environment Setup </p>  <p>Script Development Phase </p>  <p>· Script Creation </p>  <p>· Script Debugging </p>  <p>· Script Review </p>  <p>· Review Comments Incorporation </p>  <p>Script Execution Phase </p>  <p>· Environment Setup </p>  <p>· Result Analysis </p>  <p>Follow the below checklist while coming up with you initial estimation apart from effort for automation design and execution.</p>  <p>&#160;</p>  <p>   <table border="1" cellspacing="0" cellpadding="0" width="722"><tbody>       <tr>         <td valign="top" width="57">           <p>SL No.</p>         </td>          <td valign="top" width="626">           <p>Checklist</p>         </td>          <td valign="top" width="37">           <p>Y/N</p>         </td>       </tr>        <tr>         <td valign="top" width="57">           <p>1.</p>         </td>          <td valign="top" width="626">           <p>Check if you have included automation planning effort in your estimation including POC (Proof of Concept)- if any</p>         </td>          <td valign="top" width="37">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="57">           <p>2.</p>         </td>          <td valign="top" width="626">           <p>Check that you include environment preparation (installation, configuration) effort into estimations.</p>         </td>          <td valign="top" width="37">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="57">           <p>3.</p>         </td>          <td valign="top" width="626">           <p>Have you identified the Shared Steps or Common functionalities that can be later on converted into methods inside your application specific libraries to reduce automation effort and redundancy</p>         </td>          <td valign="top" width="37">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="57">           <p>4. </p>         </td>          <td valign="top" width="626">           <p>Ensure that you include effort for building framework reusable components (Libraries)</p>         </td>          <td valign="top" width="37">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="57">           <p>5.</p>         </td>          <td valign="top" width="626">           <p>Ensure that you include extra effort required if third party or custom controls are there in the application.</p>         </td>          <td valign="top" width="37">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="57">           <p>6.</p>         </td>          <td valign="top" width="626">           <p>Ensure that you include effort for code review, walkthroughs and compliance with the standards defined. </p>            <p><i>Ensure that you call out the tests which are not supported by VS 2010 as “out-of-scope” for automation. </i></p>         </td>          <td valign="top" width="37">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="57">           <p>7.</p>         </td>          <td valign="top" width="626">           <p>Ensure that you include effort for code review, walkthroughs and compliance with the standards defined</p>         </td>          <td valign="top" width="37">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="57">           <p>8.</p>         </td>          <td valign="top" width="626">           <p>Ensure that you include effort for debugging and lead time to resolve bugs discovered in the product (troubleshooting and </p>            <p>workarounds)</p>         </td>          <td valign="top" width="37">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="57">           <p>9.</p>         </td>          <td valign="top" width="626">           <p>Ensure that you include effort for reporting and result analysis.</p>         </td>          <td valign="top" width="37">           <p><b>☐</b><b></b></p>         </td>       </tr>     </tbody></table> </p>  <p><i></i></p>  <p>Now that we have the clarity on the scope, feasibility and estimates, we can move the next logical step which is creating your automation solution </p>  <p>&#160; </p>  <h4><a name="_Toc293578668"></a><a name="_Walkthrough:_Creating_a"></a><font color="#000000" size="4" face="Arial">Step 2: Creating a new Coded UI Project &amp; Adding project to Source control</font></h4>  <p><a name="_Walkthrough:_Designing_automation"></a>You can create a project from scratch or by using an existing template but it’s important to add your project to source control for version management and change tracking.     <table border="1" cellspacing="0" cellpadding="0" width="834"><tbody>       <tr>         <td valign="top" width="36">           <p>SL No.</p>         </td>          <td valign="top" width="154">           <p>Topics</p>         </td>          <td valign="top" width="588">           <p>Description</p>         </td>          <td valign="top" width="54">           <p>Y/N </p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>1.</p>         </td>          <td valign="top" width="154">           <p>Have you created new Coded UI project &amp; Added it to Source Control (TFS)? </p>            <p><i></i></p>            <p><i></i></p>         </td>          <td valign="top" width="588">           <p>Every automation project must be source controlled. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5822.image_576E787F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5822.image_5F00_576E787F.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2287.image_thumb_5E5E0537.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2287.image_5F00_thumb_5F00_5E5E0537.png" width="504" height="475" /></a> </p>            <p><i>Add project to Source Control by clicking the check box as shown</i> </p>            <p><i></i></p>            <p><i>Project Check-in Path: </i></p>            <p>All application / project specific automation code tobe maintained under respective <i>‘project node’</i> of the TFS being used for the projects. <i></i></p>            <p>Recommended Source Control Path:<i> </i></p>            <p><i>&lt;Project-Node&gt;/Main/Test/Test Automation</i> </p>            <p><i></i></p>            <p>Refer to <a href="file:///D:/raj/raj backup/VS 2010/Automation Guidance MGSI/Review/Automation Guidance/#_TFS_Check-in_Policies">Appendix: TFS Check-In Policies and Best Practices</a> for details.</p>         </td>          <td valign="top" width="54">           <p><b>☐</b><b></b></p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>2.</p>         </td>          <td valign="top" width="154">           <p>Open existing test project and using it as Template</p>         </td>          <td valign="top" width="588">           <p>Launch Visual Studio, Browse and open existing ‘CodedUISampleFramework’ template and add it to Source control. You can change the properties as per your needs. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2627.image_04AFC2B6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2627.image_5F00_04AFC2B6.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7433.image_thumb_475EE821.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7433.image_5F00_thumb_5F00_475EE821.png" width="355" height="557" /></a> </p>            <p>Please find below a short description on the folder structure of the template project which will be used for case study: </p>            <p>1. <b>Config</b>: All your application configuration details and playback settings. </p>            <p>etc will go here </p>            <p>Example: </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5344.image_292104A0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5344.image_5F00_292104A0.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3113.image_thumb_5CE8FAF1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3113.image_5F00_thumb_5F00_5CE8FAF1.png" width="504" height="251" /></a> </p>            <p>Also refer to: <a href="http://msdn.microsoft.com/en-us/library/a65txexh(v=VS.100).aspx">http://msdn.microsoft.com/en-us/library/a65txexh(v=VS.100).aspx</a> </p>            <p><b>2. </b><b>Library: </b>All your libraries- application level, data access, exceptions, utilities will go here.<b></b> </p>            <p>Please refer to <a href="file:///D:/raj/raj backup/VS 2010/Automation Guidance MGSI/Review/Automation Guidance/#_Step_3:_Automation">Step 3</a> </p>            <p><b>3. </b><b>Resources: </b>All your keys / strings that’s need to globally defined can be added here rather than hardcoding their values in code.<b></b> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1663.image_72170099.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1663.image_5F00_72170099.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8507.image_thumb_713E9AAF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8507.image_5F00_thumb_5F00_713E9AAF.png" width="511" height="124" /></a> </p>            <p><i>Example: The resource file key “SearchTimeOut” can be used to set playback settings as per your project needs without hardcoding it in your code.</i> </p>            <p>&#160;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7838.image_67962C79.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7838.image_5F00_67962C79.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7357.image_thumb_14AB1948.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7357.image_5F00_thumb_5F00_14AB1948.png" width="505" height="163" /></a> </p>            <p><b>4. </b><b>Scripts: </b>Your actual test are stored in these .cs files along with components like Test Initialize, Test Cleanup etc<b></b> </p>            <p><b></b></p>            <p><b>5. </b><b>Test Data: </b>These will contain your .CSV or .XML test data files for your data-driven automation test<b></b> </p>            <p><b></b></p>            <p><b>6. </b><b>UIMaps: </b>These will contain your test object repository along with any test methods or assertions (if any)<b></b> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5126.image_1EAF94A6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5126.image_5F00_1EAF94A6.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8037.image_thumb_61AB6313.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8037.image_5F00_thumb_5F00_61AB6313.png" width="331" height="330" /></a> </p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p><b>7. </b><b>Main Class file: </b>One class that acts as a single point interface to all the test methods and contains instantiations of the UI maps<b></b> </p>            <p><b></b></p>         </td>          <td valign="top" width="54">           <p><b>☐</b><b></b></p>         </td>       </tr>     </tbody></table> </p>  <p>With next step, we are now entering into the most important phase of Automation Lifecycle Development which involves designing your automation framework. It is worth spending time on coming up with a good design rather than doing lot of rework later due to shortsightedness and eagerness to start scripting. I would strongly recommend you spend a good effort in coming with design/framework that suits your project requirement before writing your automation test. </p>  <p>&#160; </p>  <h4><a name="_Toc293578669"></a><a name="_Step_3:_Automation"></a><font color="#000000" size="4" face="Arial">Step 3: Automation Design &amp; Development</font></h4>  <p>Automation design and framework is one of the very important pillars of your automation success and it serves as a guiding light for your team members to follow a standard and consistent automation approach across the team. </p>  <p>In this section we will be walking through the automation framework design for Coded UI projects using our Case Study’s template project. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4645.image_44E1C831.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4645.image_5F00_44E1C831.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7888.image_thumb_74DBF3E5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7888.image_5F00_thumb_5F00_74DBF3E5.png" width="678" height="597" /></a> </p>  <p>Figure 5: Proposed 3-Tier Architecture for maintaining automated test that promotes high modularity and maximum reuse with minimum maintenance effort in longer run </p>  <p>Follow the below steps for Automation design guidance:    <table border="1" cellspacing="0" cellpadding="0" width="765"><tbody>       <tr>         <td valign="top" width="38">           <p><b></b>SL No.</p>         </td>          <td valign="top" width="183">           <p>Steps</p>         </td>          <td valign="top" width="542">           <p>Description</p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>1.</p>         </td>          <td valign="top" width="183">           <p>If you have created project from scratch, add Multiple UI Map files </p>            <p><i></i></p>            <p><i>(In the template project, we already have 2 UIMap files for Case Study)</i> </p>            <p><i></i></p>            <p><i></i></p>            <p><i></i></p>            <p><i></i></p>            <p><i></i></p>         </td>          <td valign="top" width="542">           <p><b>Managing Object Repositories:</b> </p>            <p><b></b></p>            <p><b>Single UI Map File: </b></p>            <p>By default only one UIMap File is created per project and it is appropriate for a project of small size </p>            <p><b>Multiple UI Map File: </b><i>(We recommend using Multi UIMap files for modularization)</i><b><i></i></b> </p>            <p>For large application, we should use multiple UI Map. Using multiple UI Map files can provide the following benefits: </p>            <p>- Each map can be associated with a logical subset of the application. This makes changes easier to manage. </p>            <p>- Each tester can work on a section of the application and check in their code without interfering with other testers working on other sections of the application. </p>            <p>- Additions to the application UI can be scaled incrementally with minimal effect on tests for other parts of the UI </p>            <p>You can add new UIMap files by selecting Add new Items option and then selecting CodedUI Test Map type and renaming it as per your needs. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7220.image_452DAF8C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7220.image_5F00_452DAF8C.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0044.image_thumb_158F9100.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0044.image_5F00_thumb_5F00_158F9100.png" width="513" height="186" /></a> </p>            <p>The system will launch Coded UI Test Builder which can be used to add object properties to your UIMap file. Press <i>Generate Code button (Alt+G)</i>. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0474.image_32490615.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0474.image_5F00_32490615.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7762.image_thumb_49F017AE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7762.image_5F00_thumb_5F00_49F017AE.png" width="520" height="317" /></a> </p>            <p>For Case Study, you will find the UIMap files as shown below: </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1423.image_68A63FF2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1423.image_5F00_68A63FF2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4064.image_thumb_2C2DCB48.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4064.image_5F00_thumb_5F00_2C2DCB48.png" width="594" height="489" /></a> </p>            <p>Open UIMap .CS files and add User friendly names to constructor: </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5040.image_2492360E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5040.image_5F00_2492360E.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2402.image_thumb_2A00A6B2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2402.image_5F00_thumb_5F00_2A00A6B2.png" width="576" height="186" /></a> </p>            <p>Go to your Main Class file (Bing.cs) in our Case Study and instantiate each Multi UIMap file </p>            <p>&#160;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3482.image_18CCC90F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3482.image_5F00_18CCC90F.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1768.image_thumb_3C3947A7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1768.image_5F00_thumb_5F00_3C3947A7.png" width="547" height="476" /></a> </p>            <p>Please refer to <a href="file:///D:/raj/raj backup/VS 2010/Automation Guidance MGSI/Review/Automation Guidance/#_Managing_object_repository">Appendix: Managing objects using UITestEditor for</a> more details</p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>2.</p>         </td>          <td valign="top" width="183">           <p>Add/Create Libraries to your project </p>            <p><i>(For Case Study, We have already created libraries for Bing)</i></p>         </td>          <td valign="top" width="542">           <p><b></b>&#160; </p>            <p><b>Managing Libraries:</b> </p>            <p><b></b></p>            <p><b>Application Functional Libraries using Multiple UI Map files</b> </p>            <p>Ensure common functionalities identified above in planning phase are automated as reusable methods which are then invokes from your Coded UI Test methods </p>            <p>Create functional libraries as per functional modules for your application. </p>            <p><a name="_Toc254270227"></a><a name="_Toc254270272"></a><b>Common Library / Helper Classes: </b></p>            <p>a) Ensure common utilities like SQL connection, Excel/ XML, String/Date handling etc. are referenced from common library repository in your automated solution (<i>instead of creating them from scratch</i>) </p>            <p>All common libraries need to be browsed and added to automation solution as “References” </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3021.image_1DFB6426.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3021.image_5F00_1DFB6426.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2376.image_thumb_30CFE7D0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2376.image_5F00_thumb_5F00_30CFE7D0.png" width="518" height="410" /></a> </p>            <p>b) Ensure that common helper classes which are technology specific like WPF, WCR, SharePoint, Silverlight, .Net etc. are referenced in your solution (if any). </p>            <p>Refer to <a href="file:///D:/raj/raj backup/VS 2010/Automation Guidance MGSI/Review/Automation Guidance/#_Managing__common">Appendix: Managing Common Libraries in TFS</a> </p>            <p>For our case study, we have created/referenced following libaries based on the Shared Steps and scenarios identified from ‘automatable test cases’ selected in Step 1 (Automation Planning) </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3857.image_75F8192C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3857.image_5F00_75F8192C.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7673.image_thumb_0690141B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7673.image_5F00_thumb_5F00_0690141B.png" width="433" height="393" /></a> </p>            <p>Example of Application specific library methods </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3463.image_51735F1D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3463.image_5F00_51735F1D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7103.image_thumb_5E010C39.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7103.image_5F00_thumb_5F00_5E010C39.png" width="476" height="277" /></a> </p>            <p>Example of Common/Utilies based methods:</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2308.image_58EEA8BD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2308.image_5F00_58EEA8BD.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8512.image_thumb_48FF63F9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8512.image_5F00_thumb_5F00_48FF63F9.png" width="480" height="356" /></a></p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>3</p>         </td>          <td valign="top" width="183">           <p>Add your CodedUI scripts </p>            <p>/ </p>            <p>Test Methods</p>         </td>          <td valign="top" width="542">           <p>&#160; </p>            <p>Automate your ‘<i>automatable test cases’</i> as CodedUI Test Methods using application libraries, utilities and UI Maps defined above </p>            <p>a) Set the test context which provides information about and functionality for the current test run. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3324.image_3D5980ED.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3324.image_5F00_3D5980ED.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1830.image_thumb_2DD66F1E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1830.image_5F00_thumb_5F00_2DD66F1E.png" width="528" height="187" /></a> </p>            <p>b) <b>Test Initialize:</b> To perform steps before running each test like instantiating UIMap files, setting TestContext for logging etc. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6052.image_787D36EB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6052.image_5F00_787D36EB.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8032.image_thumb_083CCBF0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8032.image_5F00_thumb_5F00_083CCBF0.png" width="521" height="280" /></a> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5074.image_292018CA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5074.image_5F00_292018CA.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8032.image_thumb_2847B2E0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8032.image_5F00_thumb_5F00_2847B2E0.png" width="516" height="261" /></a> </p>            <p><b>c) </b><b>Add your Test Methods</b> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1108.image_0AA5B214.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1108.image_5F00_0AA5B214.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1033.image_thumb_47E666DB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1033.image_5F00_thumb_5F00_47E666DB.png" width="435" height="246" /></a> </p>            <p>As you can notice above that we have highlighted certain things which are not recommended like using static playback interval or hardcoding test data. We will see in next section how to handle these. </p>            <p>d) <b>Test Cleanup:</b> To run code after running each steps</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5758.image_22B8F6A2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5758.image_5F00_22B8F6A2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6428.image_thumb_3A03FB13.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6428.image_5F00_thumb_5F00_3A03FB13.png" width="543" height="250" /></a></p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>4.</p>         </td>          <td valign="top" width="183">           <p>Adding Checkpoints </p>            <p>/ </p>            <p>Assertions</p>         </td>          <td valign="top" width="542">           <p>&#160; </p>            <p>For validation in Coded UI Testing, you need to use “Assertions” </p>            <p>- <b>Creating assertions using CUIT (Coded UI Test Recorder):</b> You can create assertions without coding by using out-of-the-box feature provided with Coded UI </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4784.image_231503CA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4784.image_5F00_231503CA.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3731.image_thumb_3CD9142C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3731.image_5F00_thumb_5F00_3CD9142C.png" width="559" height="319" /></a> </p>            <p>Choose the property you want to validate and Click “Add Assertion”. </p>            <p>- <b>Creating assertions by hand coding: You</b> can create assertions by writing you own code and capturing properties against expected values to validate at the run time. </p>            <p>Verify.WaitForControlPropertyEqual(BING.SearchResultsUI.searchText, &quot;Text&quot;, &quot;Bill Gates&quot;, 15000); </p>            <p>e.g. We have a method in our Utility “Verify” that waits for control property to be equal to some text value for certain period and returns PASS if found otherwise FAIL</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3755.image_00E90A12.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3755.image_5F00_00E90A12.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1106.image_thumb_06C3ADAB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1106.image_5F00_thumb_5F00_06C3ADAB.png" width="452" height="90" /></a></p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p><b></b></p>            <p><b></b></p>            <p><b>5. </b></p>            <p><b></b></p>         </td>          <td valign="top" width="183">           <p>Make your scripts data-driven</p>         </td>          <td valign="top" width="542">           <p><b>Data-Driven Test</b> </p>            <p>Ensure every variable is parameterized by passing the test data to each test using data-driven capabilities in VS 2010. </p>            <p><i>Right-click on the Coded UI test and select Properties, to view the properties of the test</i> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1512.image_0B59B865.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1512.image_5F00_0B59B865.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4251.image_thumb_698DDFD3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4251.image_5F00_thumb_5F00_698DDFD3.png" width="482" height="384" /></a> </p>            <p>To start making this a data-driven test, we have to first create a data source for the test to draw from. On the Data Connection String property, click the ellipse button to start the New Test Data Source Wizard </p>            <p>There are three options for creating a data source: </p>            <p><b>Database</b> -- which allows you to connect to a database or Microsoft Excel spreadsheet </p>            <p><b>CSV</b> File -- which allows you to use a comma-delimited file </p>            <p><b>XML</b> File -- which allows you to use an XML file </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8484.image_10F48671.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8484.image_5F00_10F48671.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7331.image_thumb_0890B11A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7331.image_5F00_thumb_5F00_0890B11A.png" width="442" height="431" /></a> </p>            <p>When you add a data source A Data Source attribute is added to the Coded UI Test. </p>            <p>[<i>DataSource(&quot;Microsoft.VisualStudio.TestTools.DataSource.CSV&quot;, &quot;|DataDirectory|\\data.csv&quot;, &quot;data#csv&quot;, DataAccessMethod.Sequential), DeploymentItem(&quot;data.csv&quot;), TestMethod]</i> </p>            <p>For our Case study, let’s look at one of our data-driven test: </p>            <p>a) We have a method in our data access library (Utilies) to read the data from data sources using the test context </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2045.image_68D1B184.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2045.image_5F00_68D1B184.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7750.image_thumb_67F94B9A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7750.image_5F00_thumb_5F00_67F94B9A.png" width="568" height="209" /></a> </p>            <p>b) Another method as part of Application library returns the data from data source and inputs the same to application using the above data access library method </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2860.image_71FDC6F8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2860.image_5F00_71FDC6F8.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0407.image_thumb_09B4FE5F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0407.image_5F00_thumb_5F00_09B4FE5F.png" width="562" height="185" /></a> </p>            <p>c) Test data source which is stored in .CSV format </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1805.image_2BDCE418.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1805.image_5F00_2BDCE418.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5102.image_thumb_44004E73.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5102.image_5F00_thumb_5F00_44004E73.png" width="561" height="124" /></a> </p>            <p>d) Our Data-driven test method calls the above method as part of our functional</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1488.image_071BA6D4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1488.image_5F00_071BA6D4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6786.image_thumb_7E4B9E87.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6786.image_5F00_thumb_5F00_7E4B9E87.png" width="559" height="224" /></a></p>         </td>       </tr>     </tbody></table> </p>  <p>Now I suppose you have your automation tests candidates designed and developed. After you write and debug your scripts its important to run them in a batch or as part of a suite. There are various way to do that and factors to keep in mind as we will see in next section. </p>  <p>&#160; </p>  <h4><a name="_Toc293578670"><font color="#000000" size="4" face="Arial">Step 4: Automation Execution &amp; Deployment</font></a></h4>  <p><a name="_Walkthrough:_Error_handling,"></a>Ensure you have configured test settings to capture logs, code coverage, test impact etc. and you also need to keep in mind that your script should be able to successfully run in multiple environment (for ex. Test to UAT) </p>  <p>After automation design and debugging is completed, you can now run and deploy your automation scripts using the below steps:    <table border="1" cellspacing="0" cellpadding="0" width="652"><tbody>       <tr>         <td valign="top" width="38">           <p>SL No.</p>         </td>          <td valign="top" width="176">           <p>Areas</p>         </td>          <td valign="top" width="436">           <p>Description</p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>1.</p>         </td>          <td valign="top" width="176">           <p><i></i></p>            <p><i>Configuring Test Settings</i> </p>            <p><i></i></p>         </td>          <td valign="top" width="436">           <p><b>Test Settings</b> </p>            <p>a) <b>Data and Diagnostic</b>: Enable appropriate diagnostic are selected as shown below (<b>Code Coverage</b>, Event Log, Test Impact etc.) </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1325.image_7A11A0F5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1325.image_5F00_7A11A0F5.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6622.image_thumb_6A225C31.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6622.image_5F00_thumb_5F00_6A225C31.png" width="608" height="360" /></a> </p>            <p>b) Define other settings like Roles, Test Timeouts, Setup and Clean scripts</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4162.image_1224E584.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4162.image_5F00_1224E584.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2844.image_thumb_3E616C68.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2844.image_5F00_thumb_5F00_3E616C68.png" width="599" height="358" /></a></p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>2.</p>         </td>          <td valign="top" width="176">           <p>Deploy your test to multiple environments</p>         </td>          <td valign="top" width="436">           <p><i></i></p>            <p><i></i>&#160; </p>            <p><i>Deployment to different environments: </i><i>We want to run the same test across multiple environments to ensure everything is still working correctly.</i> </p>            <p><i>Development-&gt; Test -&gt; UAT -&gt; STAGE</i> </p>            <p>Example: We want to run these tests after each deploy to each environment. Each environment has as a different URL, username and password. </p>            <p>public UIMap() </p>            <p>{ </p>            <p>// Bind the parameters using Environment Variables. </p>            <p>string testServer = </p>            <p>Environment.GetEnvironmentVariable(&quot;TestServer&quot;); </p>            <p>string testUserName = </p>            <p>Environment.GetEnvironmentVariable(&quot;TestUserName&quot;); </p>            <p>string testUserPassword = </p>            <p>Environment.GetEnvironmentVariable(&quot;TestUserPassword&quot;); </p>            <p>} </p>            <p>Also refer: <a href="http://blogs.msdn.com/b/gautamg/archive/2010/02/23/how-to-get-same-test-running-under-different-environments.aspx">http://blogs.msdn.com/b/gautamg/archive/2010/02/23/how-to-get-same-test-running-under-different-environments.aspx</a></p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>3.</p>         </td>          <td valign="top" width="176">           <p>Command Line Execution (MSTest.Exe)</p>         </td>          <td valign="top" width="436">           <p><i></i></p>            <p><b><i>Grouping &amp; Classifying Test Methods using various parameters</i></b> </p>            <p><i></i></p>            <p>It lets you run groups of tests based on their assigned categories without the requirement to maintain test lists. </p>            <p>Go to Test View and you can filter and view your tests by setting these parameters </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0383.image_3F662FBA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0383.image_5F00_3F662FBA.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6175.image_thumb_3DB563E6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6175.image_5F00_thumb_5F00_3DB563E6.png" width="600" height="307" /></a> </p>            <p><b>MSTest.EXE Options</b><b><i>: </i></b><b></b></p>            <p>MSTest.exe is the command-line command that is used to run tests. This command has several options that you can use to customize your test run. You can specify these options in any order on the MSTest.exe command line. </p>            <p>Example: </p>            <p><i>mstest /testcontainer:&quot;C:\TestProject2\generictest1.generic&quot; /test:testproject32\generic </i></p>            <p>Refer to <a href="http://msdn.microsoft.com/en-us/library/ms182489.aspx">http://msdn.microsoft.com/en-us/library/ms182489.aspx</a> </p>            <p><i></i></p>         </td>       </tr>     </tbody></table> </p>  <p>With this, we come to the end of our case study where we walked you through the complete automation development life cycle that involved Automation Planning, Automation Design and Development, and finally Automation execution and Deployment. </p>  <p>Automation scripts are just ‘Code’ at the end of the day and we can’t deny the importance of having high quality of code and best practices adopted for making our automation tests not only readable and easy to troubleshoot but also for long term maintainability. </p>  <p>&#160; </p>  <h3><a name="_Toc284684681"></a><a name="_Toc284684673"></a><a name="_Toc293578671">Coding standards and best practices</a></h3>  <p>We recommend following the below checklist and recommendations for your automation code. It is the responsibility of the entire team to follow these and imbibing a culture of peer and lead review of the automation code on a regular basis. </p>  <h4>&#160;</h4>  <h4><a name="_Toc293578672"><font color="#000000" size="4" face="Arial">Checklist</font></a></h4>  <p>&#160;</p>  <table border="1" cellspacing="0" cellpadding="0" width="603"><tbody>     <tr>       <td valign="top" width="51">         <p>SL No.</p>       </td>        <td valign="top" width="164">         <p>Topic</p>       </td>        <td valign="top" width="386">         <p>Description</p>       </td>     </tr>      <tr>       <td valign="top" width="51">         <p>1.</p>       </td>        <td valign="top" width="164">         <p><i></i></p>          <p>Object Synchronization </p>          <p>over static wait/delay </p>          <p><i></i></p>       </td>        <td valign="top" width="386">         <p>These synchronization points will make the scripts more resilient and robust. </p>          <p><b>Wait for Control options: </b></p>          <p>Ensure that you insert synchronization points by waiting for the object to be ready/exist/enabled etc. before trying to perform any critical action<i>. </i></p>          <p>Example: <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitesting.uitestcontrol.waitforcontrolready(VS.100).aspx">WaitForControlReady</a>(),<a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitesting.uitestcontrol.waitforcontrolexist(VS.100).aspx">WaitForControlExist</a>() etc </p>          <p><b><i>Static </i></b><b><i>Delay</i></b><i>: </i></p>          <p><i></i></p>          <p><i>Ensure that you use WaitForControl options as much as possible but in some unavoidable cases where you must have to hard wait/sleep use </i><a href="http://msdn.microsoft.com/en-us/library/dd984394(VS.100).aspx">Playback.Wait</a>() API instead of <a href="http://msdn.microsoft.com/en-us/library/system.threading.thread.sleep.aspx">Thread.Sleep</a>() API.</p>       </td>     </tr>      <tr>       <td valign="top" width="51">         <p>2.</p>       </td>        <td valign="top" width="164">         <p>Exceptions and Error Handling</p>       </td>        <td valign="top" width="386">         <p><i>Ensure that you use the exception handling feature in all your scripts that </i>C# provides i.e. try, catch and finally to do exception handling. The try encloses the statements that might throw an exception whereas catch handles an exception if one exists. The finally can be used for doing any cleanup process. </p>          <p>The general form try-catch-finally in C# is shown below&#160; </p>          <p>try            <br />{             <br />// Statement which can cause an exception.             <br />}             <br />catch(Type x)             <br />{             <br />// Statements for handling the exception             <br />}             <br />finally             <br />{             <br />//Any cleanup code             <br />}</p>       </td>     </tr>      <tr>       <td valign="top" width="51">         <p>3.</p>       </td>        <td valign="top" width="164">         <p>Logging</p>       </td>        <td valign="top" width="386">         <p><i></i></p>          <p>Sample Logging Code: </p>          <p>1: [TestMethod] </p>          <p>2: public void CodedUITestMethod1() </p>          <p>3: { </p>          <p>4: Console.WriteLine(&quot;Console.WriteLine()&quot;); </p>          <p>5: Console.Error.WriteLine(&quot;Console.Error.WriteLine()&quot;); </p>          <p>6: TestContext.WriteLine(&quot;TestContext.WriteLine()&quot;); </p>          <p>7: Trace.WriteLine(&quot;Trace.WriteLine()&quot;); </p>          <p>8: Debug.WriteLine(&quot;Debug.WriteLine()&quot;); </p>          <p>9: } </p>          <p>If you check the test result window, you should see output like – </p>          <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7144.image_2A17DE78.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7144.image_5F00_2A17DE78.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8540.image_thumb_286712A4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8540.image_5F00_thumb_5F00_286712A4.png" width="592" height="318" /></a> </p>          <p>Each of these ways have their own advantages and disadvantages - </p>          <p>TestContext.WriteLine: </p>          <p>Advantage - Shows up property in the separate section in test result. It is meant for this purpose only. </p>          <p>Disadvantage - You will have to pass TestContext around from you main test class to other classes (like UIMap class in Coded UI Test) to use it. </p>          <p>Recommendation – Prefer this over other methods for tracing in test code. </p>          <p>Trace.WriteLine: </p>          <p>Advantage – Shows up in VS Output window too during debugging. </p>          <p>Disadvantage - The message here could be lost among other trace messages from other components (or product code). </p>          <p>Recommendation – Use it in your product code but avoid in test code. That is good way to separate out messages from product code vs test code. You can use this though in certain scenarios where either TestContext is not there or you want to determine the sequence of operation between test &amp; product code </p>          <p>Debug.WriteLine: Same as Trace.WriteLine except that this shows up only for Debug build and is no-op in Retail build. </p>          <p>Console.WriteLine and Console.Error.WriteLine: These, though work, are tricky. The test harness redirects the Standard Output and Standard Error to capture the output\error from your product code and not for tracing. So, the recommendation is to avoid using these. </p>          <p>In short, use TestContext.WriteLine wherever possible. </p>          <p><i></i></p>          <p><i></i></p>       </td>     </tr>      <tr>       <td valign="top" width="51">         <p>4. </p>          <p>1.</p>       </td>        <td valign="top" width="164">         <p>Naming Conventions</p>       </td>        <td valign="top" width="386">         <p>When you create a method, use a meaningful method name instead of the default name. A meaningful name helps identify the purpose of the method. </p>          <p>In the application under test, use meaningful names when you create the UI controls. This gives more meaning and usability to the automatically generated control names. </p>          <p><i></i></p>       </td>     </tr>      <tr>       <td valign="top" width="51">         <p>5.</p>       </td>        <td valign="top" width="164">         <p>Comments</p>       </td>        <td valign="top" width="386">         <p>Have extensive and meaningful comments. Remember that code written by you will be around for a long time and has to be understood, extended and debugged by others who do not have the entire context you had when the code was originally developed. Unless there are good comments, it is hard for even the owner to understand the code few weeks or months later.</p>       </td>     </tr>      <tr>       <td valign="top" width="51">         <p>6. </p>       </td>        <td valign="top" width="164">         <p>Startup &amp; Cleanup Scripts</p>       </td>        <td valign="top" width="386">         <p>Using Code: Create a test in your test project. In the test class, create methods with the [<b>TestInitialize</b>] and [<b>TestCleanup</b>] attributes. They will be run before/after each test method. </p>          <p>Or, if you want to run before/after all test in that class, create static methods with [<b>ClassInitialize</b>] and [<b>ClassCleanup</b>] attributes. </p>          <p>Lastly, to run before/after all tests in the assembly, create static methods with [<b>AssemblyInitialize</b>] and [<b>AssemblyCleanup</b>] attributes.</p>       </td>     </tr>   </tbody></table>  <h4></h4>  <p>We are also providing a compilation of best practices collected from various forums which can be used as a reminder when writing coded UI test. </p>  <p>&#160; </p>  <h4><a name="_Toc293578673"></a><a name="_Toc284684684"><font color="#000000" size="4" face="Arial">Do’s and Don’ts of UI Automation</font></a></h4>  <p><b>Do(s)</b> </p>  <p>o Each recorded method should act on a single page, form, or dialog box. Create a new test method for each new page, form or dialog box. </p>  <p>o Use the Coded UI Test Builder whenever possible. </p>  <p>o Explicitly set focus to the window on which the test Case is expected to input data. </p>  <p>o When possible, limit each recorded method to fewer than 10 actions. This modular approach makes it easier to replace a method if the UI changes. </p>  <p>o Create a separate <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitest.common.uimap.uimap.aspx">UIMap</a> file for each module in your application under test. For more information, see <a href="http://msdn.microsoft.com/en-us/library/ff398056.aspx">Testing a Large Application with Multiple UI Maps</a>. </p>  <p>o If you are creating assertions by coding with the API, create a method for each assertion in the part of the <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitest.common.uimap.uimap.aspx">UIMap</a> class that is in the UIMap.cs file. Call this method from your test method to execute the assertion. </p>  <p>o Capture screen shots for failures. Helps in debugging. </p>  <p>o Leave the UI in a known state after a test Case is done executing. E.g.: Close the wizard even if the test Case is to test the first screen of a wizard by cancelling out of the wizard after the first screen. </p>  <p>o Validate that the object being created using the UI with the one being stored in the backend system </p>  <p>o Log before you do something, not after. </p>  <p>o In code reviews for test cases, or new framework automation support review the log messages, is it clear what the test did from just the log?    <table cellspacing="0" cellpadding="0"><tbody>       <tr>         <td valign="top">           <p>o Log the origin of messages. If the framework logs, say that it logged, if the test case logged, say that.</p>         </td>       </tr>     </tbody></table> </p>  <p>o Have two assertion modes that are configurable: 1. Fail instantly. 2. Delay assertion of failure until the test has completed. Steps might be mutually exclusive, you’re losing coverage. </p>  <p>o Log non-fatal exceptions so as not to abort a test, bubble fatal exceptions up to the test and let the exception assert failure. </p>  <p>o Log every valid UI operation being performed in the test Case. </p>  <p>o Use resource files for all data required to be entered in the UI. </p>  <p>o Use Refactoring: Refactoring implies removing a block of code that is being used repeatedly throughout the program into a single function. This helps in reuse of code and makes the code cleaner, and improves readability.&#160; </p>  <p>o Use Constructor of classes for meaningful things: In any class avoid unnecessary overloading of constructors. Minimize the amount of work done in a constructor. Constructors should mainly be used for initialization of members. It is always good practice to have accessory methods (get/set) to expose member variables and also initialize them. </p>  <p>o Using string. Compare () instead of &quot;==&quot; or &quot;Equals ()&quot;: It is advisable use string.compare() as in that case we don't have to worry about NullPointerException, unlike using Equals() -- you have to make sure that the object that calls Equals() is not null.&#160; </p>  <p>o Using List&lt;class name&gt; instead of Arrays: Arrays are not type safe, so it is advisable to use the inherent .Net 2.0 collection objects like IList&lt;T&gt;, ICollections&lt;T&gt;. They provide additional type-checking during compile time. </p>  <p>o Use “this.”: Whenever you use a member variable of class, it is a good practice to put &quot;this&quot; in front of the variable. This improves readability and avoids conflicts when the parameter name and the member variable names are same. </p>  <p>o Using .NET attributes for test cases: Attributes provide a mechanism to enable additional data to the Test Code during runtime and it also helps in keeping information associated with the Test Case in the code itself. </p>  <p><b>Don’t(s):</b> </p>  <p><b></b></p>  <p>o Do not modify the UIMap.designer.cs file directly. If you do this, the changes to the file will be overwritten. </p>  <p>o Do not log multiple times. </p>  <p>o Do not sleep after every UI operation. </p>  <p>o Do not give unusually long timeouts for every major operation. </p>  <p>o Fail immediately after an unexpected screen. </p>  <p>o Do not re-launch the UI application for every test Case as it is a time consuming process. </p>  <p>o Test cases should never have hard-coded strings. This includes control ids, menu paths, etc. Even control <a href="http://wiki/wikiedit.aspx?topic=Microsoft.Teams.EEG.IDs&amp;return=Microsoft.Teams.EEG.UITestAutomation">IDs</a> and menu paths change over time. </p>  <p>o Do not use sleep </p>  <p>o Avoid too many parameters in a Method/Function. It is best practice to avoid passing too many parameters to a function or method. This indicates lack of abstraction. In this case encapsulating the parameters in a separate class or struct may help. </p>  <p>o Avoid Lengthy Functions: If a function is longer than a page, it is a good practice to break it up into smaller functions. However, if the code has a switch statement or straight line code with no loop back, then it is still OK, but in almost all other cases, the code can be simplified by splitting it up into multiple functions. </p>  <p>o Avoid Hard-Coded strings: Avoid the usage of hard coded strings in the code. Instead use the constants utility to store them. </p>  <p>&#160; </p>  <h3><a name="_Toc284684659"></a><a name="_Toc293578674">Appendix</a></h3>  <h4><a name="_Toc293578675"></a><a name="_Pre-Requisites:_Installation_and"></a>&#160;</h4>  <h4><font color="#000000" size="4" face="Arial">i. Getting Started with VS 2010 Coded UI</font></h4>  <p>&#160;</p>  <table border="1" cellspacing="0" cellpadding="0" width="705"><tbody>     <tr>       <td valign="top" width="144">         <p>Getting Started</p>       </td>        <td valign="top" width="559">&#160;</td>     </tr>      <tr>       <td valign="top" width="144">         <p>Online Help</p>       </td>        <td valign="top" width="559">         <p><a href="http://msdn.microsoft.com/en-us/library/dd286726(VS.100).aspx">Testing the User Interface with Automated UI Tests</a></p>       </td>     </tr>      <tr>       <td valign="top" width="144">         <p>Forum</p>       </td>        <td valign="top" width="559">         <p><a href="http://social.msdn.microsoft.com/Forums/en-US/vsautotest/threads">Visual Studio UI Automation Testing (includes CodedUI)</a></p>       </td>     </tr>      <tr>       <td valign="top" width="144">         <p>Product Overview</p>       </td>        <td valign="top" width="559">         <p><a href="http://blogs.msdn.com/amit_chatterjee/archive/2009/03/14/coded-ui-test.aspx">Coded UI Test              <br /></a></p>       </td>     </tr>      <tr>       <td valign="top" width="144">         <p>Webcasts &amp; Videos</p>       </td>        <td valign="top" width="559">         <p><a href="https://channel9.msdn.com/shows/10-4/10-4-Episode-18-Functional-UI-Testing/">Functional UI Testing</a>             <br /><a href="https://channel9.msdn.com/posts/TheOliver/Visual-Studio-Team-System-2010-Manual-Test-To-Coded-UI-Test/">Visual Studio Team System 2010: Manual Test To Coded UI Test              <br /></a></p>       </td>     </tr>      <tr>       <td valign="top" width="144">         <p>Guidance and References</p>       </td>        <td valign="top" width="559">         <p><a href="http://msdn.microsoft.com/en-us/library/dd380782(VS.100).aspx">Best Practices for Coded UI Tests</a></p>       </td>     </tr>      <tr>       <td valign="top" width="144">         <p>Coded UI Test Bloggers</p>       </td>        <td valign="top" width="559">         <p><a href="http://blogs.msdn.com/anutthara/">Anutthara Bharadwaj</a>             <br /><a href="http://blogs.msdn.com/gautamg/">Gautam Goenka              <br /></a><a href="http://blogs.msdn.com/balagans/">Balachander G. Subramaniam</a>             <br /><a href="http://blogs.msdn.com/rubel">Rubel Singhal              <br /></a><a href="http://blogs.msdn.com/rituparna/">Rituparna Paul</a>             <br /><a href="http://blogs.msdn.com/vstsqualitytools/">Team Blog</a></p>       </td>     </tr>      <tr>       <td valign="top" width="144">         <p>What’s new in Beta2</p>       </td>        <td valign="top" width="559">         <p><a href="http://blogs.msdn.com/anutthara/archive/2009/10/25/what-s-new-for-testers-doing-ui-automation-in-vs-2010-beta2.aspx">What’s new for testers doing UI Automation</a></p>       </td>     </tr>   </tbody></table>  <h4>&#160;</h4>  <h4><a name="_Toc293578676"><font color="#000000" size="4" face="Arial">ii. Visual Studio 2010 Installation</font></a></h4>  <p>This step is required to ensure that environment is setup and configured to get started with automation, </p>  <p>- <i>Installation: Have you installed VS 2010 Ultimate? </i></p>  <p><i></i></p>  <p><i>Go to </i><a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=06a32b1c-80e9-41df-ba0c-79d56cb823f7"><i>Microsoft.com Download page</i></a><i></i> </p>  <p><i></i></p>  <p>- <i>Installation: Have you installed VS 2010 Feature Pack 2</i> </p>  <p><i></i></p>  <p><i>Refer to </i><a href="http://msdn.microsoft.com/en-us/vstudio/ff655021.aspx"><i>http://msdn.microsoft.com/en-us/vstudio/ff655021.aspx</i></a><i> to find out new features in FP2</i> </p>  <p><i></i></p>  <p>- <i>Installation: Have you connected to you Source control (TFS node)?</i> </p>  <p><i></i></p>  <p><i>Go to VS 2010 Ultimate -&gt; Team -&gt; Connect to Team Foundation Server</i> </p>  <p><i>Add your TFS server name, Choose Project Collection, Select your team project and say Connect</i> </p>  <p>&#160; </p>  <h4><a name="_Toc293578677"></a><a name="_Automation_Estimation"></a><a name="_TFS_Check-in_Policies"></a><font color="#000000" size="4" face="Arial">iii. TFS Check-in Policies &amp; Best Practices</font></h4>  <p>- Ensure that policies enforced by project administrator are met </p>  <p><b></b></p>  <p>Tip: For example “comment” must be entered every time checking the code </p>  <p><a href="http://msdn.microsoft.com/en-gb/library/ms181460.aspx">http://msdn.microsoft.com/en-gb/library/ms181460.aspx</a> </p>  <p>Apart from that, following are available by default </p>  <p>o Builds:&#160;&#160; Requires that the last build was successful before a check-in. </p>  <p>o Code Analysis:&#160; Requires that code analysis is run before check-in. </p>  <p>o Testing Policy:&#160; Requires that certain tests are completed before check-in. </p>  <p>o Work Items:&#160;&#160; Requires that one or more work items be associated with the check-in. </p>  <p><a href="http://msdn.microsoft.com/en-gb/library/ms181411.aspx">http://msdn.microsoft.com/en-gb/library/ms181411.aspx</a> </p>  <p><a href="http://msdn.microsoft.com/en-gb/library/ms245460(v=VS.100).aspx">http://msdn.microsoft.com/en-gb/library/ms245460(v=VS.100).aspx</a> </p>  <p>- <b></b>Ensure that any custom policies enforced by administrator are met. </p>  <p><b></b></p>  <p>- As a best practice, check-in the files at the end of the day </p>  <p><b></b></p>  <p>- Code Branching and Merging </p>  <p><b></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4527.image_3675DBD4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4527.image_5F00_3675DBD4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6683.image_thumb_3C507F6D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6683.image_5F00_thumb_5F00_3C507F6D.png" width="616" height="206" /></a> </p>  <p>One of the most common branching strategies is to align branches with product releases. A branch holds all the software development assets for a single release. Occasionally, you must merge updates from one release to another, but they usually never merge. You discontinue a branch when you discontinue its release. </p>  <p>The mechanics of branching in TFS are simplified to a single right-click à Branching and Merging | Branch command. </p>  <p>Figure 6: <a href="http://tfsbranchingguideiii.codeplex.com/">Courtesy: ALM Rangers Codeplex Branching guidance</a> </p>  <p>If you have more than one work (DEVELOPMENT) branch, forward integration to all work branches should occur as soon as any branch integrates into the MAIN branch. Because the MAIN branch is kept stable, forward integration is safe.. </p>  <p>Refer to <a href="http://msdn.microsoft.com/en-us/library/ee782536.aspx">http://msdn.microsoft.com/en-us/library/ee782536.aspx</a> and <a href="http://tfsbranchingguideiii.codeplex.com/">http://tfsbranchingguideiii.codeplex.com/</a> for detailed guidance from ALM Rangers team </p>  <p><b></b></p>  <p>- <b>Ensure Reverse Integration and Forward Integration process when multiple teams (Onsite Offshore are working together on same engagement)</b> </p>  <p>FORWARD INTEGRATE (FI) – merges from parent to child branches. </p>  <p>REVERSE INTEGRATE (RI) – merges from child to parent branches </p>  <p>Refer to <a href="http://branchingguidance.codeplex.com/wikipage?title=Code%20Promotion%20Best%20Practices">http://branchingguidance.codeplex.com/wikipage?title=Code%20Promotion%20Best%20Practices</a> </p>  <p>- <b>Gated Check-ins: Ensure the solution is built before the automation code check-in</b><b></b> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0310.image_79913434.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0310.image_5F00_79913434.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5444.image_thumb_62728D2B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5444.image_5F00_thumb_5F00_62728D2B.png" width="647" height="378" /></a> </p>  <p>By using a gated check-in for the MAIN branch, you help make the reverse integration much easier because quality gates help avoid conflicts or errors in the MAIN branch. For more information, see <a href="http://msdn.microsoft.com/en-us/library/dd794776.aspx">http://msdn.microsoft.com/en-us/library/dd794776.aspx</a> and <a href="http://blogs.msdn.com/b/patcarna/archive/2009/06/29/an-introduction-to-gated-check-in.aspx">http://blogs.msdn.com/b/patcarna/archive/2009/06/29/an-introduction-to-gated-check-in.aspx</a> </p>  <p><a href="http://intovsts.net/2010/04/18/the-gated-check-in-build-in-tfs2010/">http://intovsts.net/2010/04/18/the-gated-check-in-build-in-tfs2010/</a> </p>  <p>When this trigger is selected for a build definition, any check-in that is made to a file that is mapped in the associated workspace will trigger a verification build. If the build succeeds, the changes will be submitted to the repository. If the build fails, the changes are not allowed to be submitted and must be fixed and resubmitted. </p>  <h4><a name="_Toc276381721"></a><a name="_Toc293578678"></a><a name="_Getting_Started"></a>&#160;</h4>  <h4><font color="#000000" size="4" face="Arial">iv. Coded UI Frameworks</font></h4>  <p>&#160;</p>  <table border="1" cellspacing="0" cellpadding="0" width="751"><tbody>     <tr>       <td valign="top" width="202">         <p>Details of each UI Framework Supported - Differences, Known Issues and Workarounds</p>       </td>        <td valign="top" width="547">&#160;</td>     </tr>      <tr>       <td valign="top" width="202">         <p>Web</p>       </td>        <td valign="top" width="547">         <p><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/04/13/uitest-framework-ie-plugin-part-1.aspx">IE Plugin Part 1</a>             <br /><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/04/13/uitest-framework-ie-plugin-part-2.aspx">IE Plugin Part 2</a>             <br /><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/04/15/uitest-framework-mozilla-firefox-support-in-vs-2010.aspx">UI Test Framework Firefox support</a></p>       </td>     </tr>      <tr>       <td valign="top" width="202">         <p>WinForms</p>       </td>        <td valign="top" width="547">         <p><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/04/13/uitest-framework-winforms-plugin-part-1.aspx">WinForms Plugin Part 1</a>             <br /><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/04/13/uitest-framework-winforms-plugin-part-2.aspx">WinForms Plugin Part 2</a></p>       </td>     </tr>      <tr>       <td valign="top" width="202">         <p>WPF</p>       </td>        <td valign="top" width="547">         <p><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/04/13/uitest-framework-wpf-plugin-part-1.aspx">WPF Plugin Part 1</a>             <br /><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/04/13/uitest-framework-wpf-plugin-part-2.aspx">WPF Plugin Part 2</a></p>       </td>     </tr>      <tr>       <td valign="top" width="202">         <p>SharePoint</p>       </td>        <td valign="top" width="547">         <p><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/04/15/uitest-framework-sharepoint-support-for-vs-2010.aspx">UI Test Framework Sharepoint support</a></p>       </td>     </tr>      <tr>       <td valign="top" width="202">         <p>MFC/Win32</p>       </td>        <td valign="top" width="547">         <p><a href="http://blogs.msdn.com/vstsqualitytools/archive/2010/04/15/uitest-framework-mfc-support-in-vs-2010.aspx">UI Test Framework MFC support</a></p>       </td>     </tr>   </tbody></table>  <h4><a name="_Toc293578679"></a><a name="_Managing__common"></a>&#160;</h4>  <h4><font color="#000000" size="4" face="Arial">v. Managing common libraries in TFS</font></h4>  <p>All common code and libraries to be maintained at a centralized node which wil be accessible (read-only) to all the projects/apps to be included for reusability. </p>  <p>Note: Only the automation group member will have the add/edit permission on this node to control the change. </p>  <p>Common TFS Project &amp; Node: &lt; placeholder &gt; </p>  <p>Library Path: Automation/Libraries </p>  <p>&#160; </p>  <h4><a name="_Toc293578680"><font color="#000000" size="4" face="Arial">vi. Data driven testing</font></a></h4>  <p>Use below link if you need more information about Data driven testing using Coded UI and access/store data in MS EXCEL from Coded UI </p>  <p><a href="http://blogs.msdn.com/b/mathew_aniyan/archive/2009/03/17/data-driving-coded-ui-tests.aspx">Data Driven Testing by Mathew</a> </p>  <p><a href="http://msdn.microsoft.com/en-us/library/ee624082(VS.100).aspx">http://msdn.microsoft.com/en-us/library/ee624082(VS.100).aspx</a> </p>  <p><a href="http://msdn.microsoft.com/en-us/magazine/cc163536.aspx">http://msdn.microsoft.com/en-us/magazine/cc163536.aspx</a> </p>  <p>&#160; </p>  <h4><a name="_Toc293578681"></a><a name="_Managing_object_repository"></a><font color="#000000" size="4" face="Arial">vii. Managing object repository using UI Test Editor</font></h4>  <p>This is a new feature launched in FP2 which lets you better manage your object repository. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1643.image_1F92F659.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1643.image_5F00_1F92F659.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4370.image_thumb_75CF7B65.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4370.image_5F00_thumb_5F00_75CF7B65.png" width="733" height="360" /></a> </p>  <p>The Coded UI Test Editor toolbar offers the following commands: </p>  <p>1. Find helps to locate UI actions and controls. </p>  <p>2. <a href="http://msdn.microsoft.com/en-us/library/gg269461.aspx">Delete</a> removes unwanted UI actions. </p>  <p>3. Rename changes the names for test methods and controls. </p>  <p>4. Properties Opens the Properties Window for selected item. </p>  <p>5. <a href="http://msdn.microsoft.com/en-us/library/gg269465.aspx">Split into a new method</a> lets you modularize the UI actions. </p>  <p>6. <a href="http://msdn.microsoft.com/en-us/library/gg269473.aspx">Move Code</a> adds custom code to your test methods. </p>  <p>7. <a href="http://msdn.microsoft.com/en-us/library/gg316453.aspx">Insert Delay Before</a> adds a pause prior to a UI action specified in milliseconds. </p>  <p>8. <a href="http://msdn.microsoft.com/en-us/library/gg269460.aspx">Locate the UI Control</a> identifies the location of the control in the UI of application under test. </p>  <p>9. <a href="http://msdn.microsoft.com/en-us/library/gg269467.aspx">Locate All</a> helps to verify control property and significant changes to the application’s controls. </p>  <p>Refer to: <a href="http://msdn.microsoft.com/en-us/library/gg269469.aspx">http://msdn.microsoft.com/en-us/library/gg269469.aspx</a> </p>  <p>&#160; </p>  <h4><a name="_Toc293578682"></a><a name="_Toc284684672"><font color="#000000" size="4" face="Arial">viii. Extending Coded UI</font></a></h4>  <p>VS 2010 Coded UI support extensibility for technologies which are not supported out-of-the-box like Excel or custom controls. </p>  <p>Refer this example for WPF calendar support </p>  <p><a href="http://blogs.msdn.com/b/tapas_sahoos_blog/archive/2010/12/10/adding-new-control-support-in-a-coded-ui-test-plugin.aspx">http://blogs.msdn.com/b/tapas_sahoos_blog/archive/2010/12/10/adding-new-control-support-in-a-coded-ui-test-plugin.aspx</a> </p>  <h4><a name="_Toc293578683"></a>&#160;</h4>  <h4><a name="_Toc284684689"><font color="#000000" size="4" face="Arial">ix. Support &amp; Help</font></a></h4>  <p>- Discussion forum (External) </p>  <p><a href="http://social.msdn.microsoft.com/Forums/en/vsautotest/threads">http://social.msdn.microsoft.com/Forums/en/vsautotest/threads</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Intelligent selection of test data by applying learning from Marketing Research</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/intelligent-selection-of-test-data-by-applying-learning-from-marketing-research</link>
      <pubDate>Sat, 10 Dec 2011 16:35:16 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2011/12/10/intelligent-selection-of-test-data-by-applying-learning-from-marketing-research/</guid>
      <description><![CDATA[&#160;  1. Abstract   2. Prospects Hot Candidates   3. Proposed Solution   4. Process: Intelligent...]]></description>
      <content:encoded><![CDATA[<h3>&#160;</h3>  <p>1. <a href="http://msdn.microsoft.com/en-us/library/gg276342#Abstract">Abstract</a> </p>  <p>2. <a href="http://msdn.microsoft.com/en-us/library/gg276342#ProspectsHotCandidates">Prospects Hot Candidates</a> </p>  <p>3. <a href="http://msdn.microsoft.com/en-us/library/gg276342#ProposedSolution">Proposed Solution</a> </p>  <p>4. <a href="http://msdn.microsoft.com/en-us/library/gg276342#Process">Process: Intelligent Sampling Process Flow &amp; Engine</a> </p>  <p>5. <a href="http://msdn.microsoft.com/en-us/library/gg276342#SamplingAlgorithmsselectedforDatabaseSampling">Sampling Algorithms selected for Database Sampling</a> </p>  <p>6. <a href="http://msdn.microsoft.com/en-us/library/gg276342#BenefitAnalysisfortheselectedalgorithms">Cost/Benefit Analysis for the selected algorithms</a> </p>  <p>7. <a href="http://msdn.microsoft.com/en-us/library/gg276342#ExtendedFeatures">Extended Features</a> </p>  <p>8. <a href="http://msdn.microsoft.com/en-us/library/gg276342#Benefits">Benefits</a> </p>  <p>9. <a href="http://msdn.microsoft.com/en-us/library/gg276342#References">References</a> </p>  <ol>   <li>     <p><strong>Abstract</strong> </p>      <p>When the data volume is not too huge, the entire data of the population can be validated as a part of the test phase (Unit testing/ Integration Testing/ System testing). Such a total study gives an excellent confidence on the quality and coverage <strong>which can be very expensive method, because validating all the data involves huge hardware cost, resource dependency and the time required for the completion of the activity</strong>. <em>Remember, too, that the objectives of a project do not always require an absolutely exact account of the entire population.</em> </p>      <p>Sampling is one approach which can be adopted when the data is voluminous. Note that sampling does not mean that you were not equally interested in all the items in the population. On the contrary, you would like to study all of them, but you pick the sample for practical reasons. Perhaps you have a population of millions of objects and it is impossible to reach even a major part of them. Also in those cases (with populations of, say, up to 10,000) where you might choose to study every object, the sampling study may be a prudent choice, because it saves your time and you can then use the time you save to study the sampled items more carefully. </p>      <p><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435096.jpg" width="642" height="163" /> </p>      <p>Few months back, we were in the middle of testing our application, which processes more than 1.50 TB of data and takes approx 36 hours of time when we received this great news that Microsoft was voted as the <em>Best Employer</em> by <em>BT TNS Mercer’s</em> <a href="http://businesstoday.intoday.in/index.php?option=com_content&amp;task=view&amp;id=9488&amp;sectionid=3&amp;secid=&amp;Itemid=1&amp;issueid=40">Best Companies to work for in India</a> &amp; it was no doubt a moment of pride but i wasn’t interviewed and none of my friends were either but it struck us how they were still able to echo our feelings so well (for most of us i spoke to were not surveyed) </p>      <p>After thinking it over for a couple of days we realized that this very same concept is very much <strong>applicable to our IT solution as well.</strong> Why do we have to process 1.5 GB of data and wait for 36 hours to run or why should i make up the data by generating it randomly and taking the risk of compromising on the coverage when i have access to customer/ production equivalent data (non PII)?         <br /><strong>         <br />The Big Question: </strong>        <br /><strong>“Why didn’t we do intelligent sampling yet?”</strong> </p>      <p><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435086.jpg" width="644" height="62" /> </p>      <p><strong>The Big Question:          <br />“Choosing Sample Test Data from Population/ Customer data is not a challenge but how do you ensure that sample is a GOOD sample”</strong>         <br />I agree, “GOOD” is a quite subjective term. Let me rephrase         <br /><strong>“How do you ensure that the sample chosen is a GOOD representative of your entire data population?”</strong>         <br /><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435239.jpg" width="656" height="74" /></p>   </li>    <li>     <p><strong>Prospects Hot Candidates:</strong> </p>      <p>Bigger the Size of font in the image below, more is the importance &amp; applicability.        <br /><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435240.jpg" width="691" height="281" /></p>   </li>    <li>     <p><strong>Proposed Solution</strong> </p>      <p>Best Sample selection based on your requirement is the true objective. There are multiple solutions in silo to cater to specific scenarios. </p>      <p>What better place to have this solution than in Visual <strong>Studio DbPro</strong>         <br /><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435241.jpg" width="417" height="378" /> </p>      <p><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435247.jpg" width="751" height="402" /></p>   </li>    <li>     <p><strong>Process: Intelligent Sampling Process Flow &amp; Engine</strong> </p>      <p><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435248.jpg" width="750" height="468" /> </p>      <ol>       <li><strong>Selection Criteria</strong>           <p><strong>i) Population Selection</strong> </p>          <p>The data set which needs to be sampled should be chosen first. This can be chosen based on the parameters of </p>          <ol>           <li><strong><em>Size</em></strong> – the dataset for sampling should be of reasonable size (&gt;500 MB). This is to make the process of data sampling worth the effort </li>            <li><strong><em>Complexity</em></strong> – If the dataset to be sampled is of lesser complexity, data generation approaches may be more suitable. It is for complex data set which involves some business rules plus data integrity to be maintained where subset data selection would help. </li>            <li><strong><em>Test cases to be run</em></strong> – Subset data selection is for a scenario where number of test cases to be run is high and considerable amount for data regression is required </li>            <li><strong><em>Variety in data</em></strong> – The dataset to be sampled contains a variety in data. For Eg. Databases of an enterprise system would be ideal. On the other hand one which contains only Taxonomy related data or domain values may not be suitable for sampling </li>         </ol>          <p><strong>ii) Business Rules / Requirements or user input / Sampling Frame</strong> </p>          <p>Whenever a sample data is selected from an existing database, one needs to ensure that the underlying business rules are intact. In order to cater to negative test case scenarios, some sample breaking the rules is also fine. However on the whole, business rules have to be maintained. </p>          <p>Most datasets where sampling is required also have some ‘business rules’ attached to them. For Eg. Expense related calculations may need checks of exchange rates; billing related calculations may need checks of status and so on. If there are business rules which are critical to the transformation of the system to be tested, these can be input by the user, to ensure that the sampling happens accordingly. </p>          <p><strong>iii) Get Expected Cost Associated From Sample from the User.</strong> </p>          <p>The user should also be able to select an expected associated cost to the sample which would be created. This cost would be based on the size/time taken for the sample generation and coverage based on data variety included in the sample. The expected associated cost entered by the user would be used to prioritize on the sample algorithms to be run, which are known to provide the expected cost. Running these algorithms with the expected cost as an input would help reach the required end result and propose different data sampling options to the user.</p>       </li>        <li><strong>Sampling Method</strong>           <p><strong>i) Data Profiling Required - Domain/Transactional Data</strong> </p>          <p>In order to go for effective sampling, we also recommend categorizing the existing dataset into tables containing ‘Master’<sup>*</sup> data and those containing transactionaldata.This could be an outcome of the Data Integrity relationship detected, or a step within the sampling engine while applying the algorithm. This categorization helps in selecting required amount of samples from each of these tables as well as selecting an appropriate sampling method. For instance, if a table contains date/calendar information, thus making it fall under a master category, would not need to be sampled or reduced; where as one containing daily transactions of an account can be a candidate for sampling. Detection of data set impacting the coverage is critical before coming up with the sampling plan.This would be done based on </p>          <p>1. Profiling the data and checking for columns which contain distinctively unique values which are sure to impact the test case/data coverage. </p>          <p>2. Get input from the user based on his prior knowledge. </p>          <p>Once this input is provided, save it to use during generating the sampling plans. </p>          <p><strong>ii) Generate Plans with associated cost</strong> </p>          <p>Generate the different plans possible for data selection and provide the‘cost’ associated with it based on the rules applied prior to sampling This cost would be calculated based on following factors: </p>          <ul>           <li>Expected size of the sample </li>            <li>Expected data coverage of the sample. </li>         </ul>          <p>The plans along with the indicator of cost associated with each of the plan would be provided to the user. Thereafter, the user could either choose the best recommended plan, or go for another based on his discretion. </p>          <p><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435256.jpg" width="292" height="300" /> </p>          <p><strong>iii) User to choose plan or go for regeneration</strong> </p>          <p>If the user is not satisfied with the plans and their cost, he can ask for a regeneration of plan which would involve trying out a different set of inputs or providing different columns for driving data coverage.</p>       </li>        <li><strong>Sampling Engine</strong>           <p>The sampling engine is expected to perform all of the above steps after scanning through the target population, as well as consuming specific inputs provided by the user. Next Steps are: </p>          <p><strong>i. Implementing the sampling plan</strong> </p>          <p><strong>ii. Reviewing the sampling process</strong> </p>          <p>The sampling engine is the core of the data selection process. Stages involved within the sampling engine: </p>          <p><strong>i) Building the Sampling Rules</strong> </p>          <ul>           <li>The sampling rules would be built based on the Data Integrity Checks run on the database as well as after profiling the data for any exceptions to business rules and categorizing data sets into master or transactional. </li>            <li>This could also include setting any delta rule condition (or in other words reducing the scope of data to be sampled              <br /><em>When a Data Volume is sampled already, the next time the Sampling Engine Runs on the same dataset, the sample is generated for the new added data rows only. This would save time, effort and money and would give more ROI to the proposed feature inclusion in VSTF DB Pro.</em> </li>            <li>These sampling rules would form the underlying conditions which need to be satisfied by the selected database. </li>            <li>This ensures that after selecting a sample from the source system, when we run our ETL process on it, the ETL should not break due to incorrect sample set. </li>         </ul>          <p><strong>ii) Apply algorithm</strong> </p>          <ul>           <li>The algorithms chosen for application within the sampling engine are covered in next section (Section 7). Each of the above algorithms would be applied to the source system data and cost for the same would be calculated </li>         </ul>          <p><strong>iii) Calculate Sampling Cost :</strong> </p>          <p>We define sampling cost based on two parameters </p>          <ul>           <li>Sample Size </li>            <li>Data coverage </li>         </ul>          <p>The Sampling Cost would be calculated based on the Size (This could be Row Count of each table available in the sample or the actual Size in MB/GB). This percentage reduction in Size would act as one parameter in Cost. Data Coverage in the sample would be detected differently by differently algorithms. If the algorithm is probabilistic, frequency of data would be a key in determining coverage, if statistical algorithm is used, distinct values in columns would form key criteria and in T-Way, the requirements would be primary. This would be covered in detail in the subsequent section. </p>          <p><strong>iv) Check for correctness and update the Sampling Rules</strong> </p>          <p>Identify if the sample satisfies the basic rules and if the user wishes he/she could opt for re-sampling, and this time fine-tune the rules as well as inputs provided. </p>          <p><strong>v) Log Errors</strong> </p>          <p>Any errors encountered during the process of profiling/sampling method generation would have to be logged and reported.            <br />The diagram below shows an end-to-end mock of the screens that could show up during this process of sampling method generation and selection and the various inputs that need to be provided by the user and the actions that take place.             <br /><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435258.jpg" width="771" height="541" /></p>       </li>     </ol>   </li>    <li>     <p><strong>Sampling Algorithms selected for Database Sampling</strong> </p>      <p>Within any of the types of frame identified above, a variety of sampling methods can be employed, individually or in combination. Factors commonly influencing the choice between these designs include: </p>      <ul>       <li><em>Nature and quality of the frame</em> </li>        <li><em>Availability of auxiliary information about units on the frame</em> </li>        <li><em>Accuracy requirements, and the need to measure accuracy</em> </li>        <li><em>Whether detailed analysis of the sample is expected</em> </li>        <li><em>Cost/operational concerns</em> </li>     </ul>      <p><strong>a) Probabilistic Sampling Methods - Multi-Stage Sampling</strong> </p>      <p>In most real applied application, we would use sampling methods that are considerably more complex than simple methods like (random sampling, cluster, stratified, systematic etc). The most important principle here is that we can combine the simple methods in a variety of useful ways that help us address our sampling needs in the most efficient and effective manner possible. When we combine different probabilistic sampling methods, we call this <strong>Multi-Stage sampling</strong>. By combining different sampling methods we are able to achieve a rich variety of probabilistic sampling methods that can be used in a wide range of social research contexts. This leads to less Sampling Error by relying on multiple randomizations by choosing random samples of preceding random samples. </p>      <p><strong>3-Stage Multi-Stage Sample Process</strong> </p>      <ol>       <li>Select the clusters from the population </li>        <li>Select all strata from each clusters </li>        <li>In next stages, select additional random sample from selected strata units and so on </li>        <li>Finally all ultimate samples selected are chosen </li>     </ol>      <p><strong>b) Statistical Sampling – Purposive Sampling</strong> </p>      <p>The difference between non-probability and <a href="http://www.socialresearchmethods.net/kb/sampprob.php">probability sampling</a> is that non-probability sampling does not involve <em>random</em> selection and probability sampling does. Most sampling methods are purposive in nature because we usually approach the sampling problem with a specific plan in mind. In purposive sampling, we sample with a <em>purpose</em> in mind. We usually would have one or more specific predefined groups we are seeking. Useful when you need to reach a targeted <strong>sample quickly</strong> and where <strong>sampling for proportionality is not the primary concern.</strong> </p>      <p><em>For ex. have you ever run into guys in a mall asking people if they could interview them? Most likely they are conducting a purposive sample. They might be looking for Caucasian females between 30-40 years old as that’s their need and they do that by estimating</em> </p>      <p>One caveat is that you are also likely to overweight subgroups in your population that are more readily accessible. </p>      <p><strong>c) T -Way Sampling Method</strong> </p>      <p>T-way Testing is a type of interaction testing which requires that for each t-way combination of input parameters of a system, <strong>every combination of valid values of these t parameters must be covered by at least one test case</strong>. It involves selecting test samples in such a manner that it covers all the t-wise interactions between the parameters and the possible values of a given system. </p>      <p><em>For example, Let us consider Employee Entity which contains attributes like Employee Discipline and Employee Role. Also, consider the Country Entity has attributes like CountryName and IsActive. Correspondingly, the possible values Employee Entity and Country Entity are as shown below.</em> </p>      <p><img title="" alt="" src="http://i.msdn.microsoft.com/dynimg/IC435266.jpg" /> </p>      <p>The total Number of Combinations possible for values between Employee and Country = 3*2*3*2 = <strong>36</strong> combinations. We can also say, that our code will work if I have <strong>1</strong> combination, but neither of them strikes an optimal balance between Quality Assurance and Delivery! </p>      <p><u>Applying the t-way testing methodology and setting t=2, we get the Dataset which has only <strong>9</strong> combinations</u> </p>      <p><img title="" alt="" align="left" src="http://i.msdn.microsoft.com/dynimg/IC467231.jpg" />         <br />Similarly, when t=3, the number of combinations increase but the data coverage also increases and hence the sample size increases, and it strikes an optimal balance between the size of the dataset and the code coverage. A sample run would generate <strong>14</strong> records for the current example.         <br />We propose, set t=3 to find out the optimal data combination both in terms of coverage and time.</p>   </li>    <li>     <p><strong>Cost/Benefit Analysis for the selected algorithms</strong> </p>      <p>This section will be used internally by the system to determine best algorithm for a selected population by doing a cost/benefit of each algorithm statistically </p>      <p><strong>a) Cost Benefit for Statistical Algorithms</strong> </p>      <p><img title="" alt="" src="http://i.msdn.microsoft.com/dynimg/IC435284.jpg" />         <br /><img title="" alt="" src="http://i.msdn.microsoft.com/dynimg/IC435285.jpg" /> </p>      <p><strong>b) Cost Benefit for Statistical Algorithms</strong> </p>      <p><img title="" alt="" src="http://i.msdn.microsoft.com/dynimg/IC435286.jpg" />         <br /><img title="" alt="" src="http://i.msdn.microsoft.com/dynimg/IC435291.jpg" /> </p>      <p><strong>c) Cost Benefit for T-Way Algorithm</strong> </p>      <p><img alt="" src="http://i.msdn.microsoft.com/dynimg/IC435292.jpg" width="960" height="239" /></p>   </li>    <li>     <p><strong>Extended Features:</strong> </p>      <p><strong>7.1 Avoid Re-sampling of the Sampled Data to increase data coverage</strong> </p>      <p>Sampling schemes should be generally defaulted to Without Replacement (‘<strong>WOR’</strong>). No element should be re-selected more than once in the subsequent sampling attempts if it’s already sampled in one of the past attempts <em>(unless RESAMPLI NG = 1 is explicitly configured by the user).</em> By Default, Re-Sampling Flag is set to 0 to ensure that already sampled data doesn’t always get picked in every sample run and rest of the data should get a fair chance of getting selected. </p>      <p><em>For example, if we catch fish, measure them, and immediately return them to the water before continuing with the sample, this is a WR design, because we might end up catching and measuring the same fish more than once. However, if we do not return the fish to the water (e.g. if we eat the fish), this becomes a WOR design.</em> </p>      <p>Marking already sampled data helps ensuring that the already sampled data is not picked in the future runs unless we run out of data. This basically follows the assumption that the sampling method chosen by the user / system picks the best available sample for the first run but say for the second run we don’t want to pick the already sampled data (selected based on run #) and so on. </p>      <p><img title="" alt="" src="http://i.msdn.microsoft.com/dynimg/IC436263.jpg" /> </p>      <p><strong>7.2 Weighted Sampling</strong> </p>      <p>Weights can be provided by the user in the proposed user configuration settings to give more value / importance to a specific column which is more important based on the business need. </p>      <p><img title="" alt="" src="http://i.msdn.microsoft.com/dynimg/IC436230.jpg" /> </p>      <p>More generally, data should usually be weighted if the sample design does not give each individual an equal chance of being selected. In many situations the sample fraction may be varied by stratum and data will have to be weighted to correctly represent the population. </p>      <p><em>Real World Example, a simple random sample of individuals in the United Kingdom might include some in remote Scottish islands who would be inordinately expensive to sample. A cheaper method would be to use a stratified sample with urban and rural strata. The rural sample could be under-represented in the sample, but weighted up appropriately in the analysis to compensate.</em></p>   </li>    <li>     <p><b>Benefits</b> </p>      <p>The following are direct /indirect benefits to the various stakeholders like Dev, Test, PM’s &amp; Business Community. </p>      <ul>       <li>Overall Test Execution Time Reduction </li>        <li>Higher Requirement &amp; Test Coverage </li>        <li>Higher Code Coverage </li>        <li>Effective Unit Testing &amp; Functional Testing -Boundary Values, Equivalence Partitioning </li>        <li>Reduces Hardware Cost for IT </li>        <li>High confidence while delivering to Test, UAT &amp; Production </li>        <li>Increased Domain knowledge &amp; business understanding of the resource while choosing &amp; profiling the sample data </li>        <li>Earlier detection of potential Data Quality issues by analyzing the data (while profiling) for sampling </li>     </ul>   </li>    <li>     <p><strong>References</strong> </p>      <p><a href="http://en.wikipedia.org/wiki/Sampling_(statistics)">http://en.wikipedia.org/wiki/Sampling_%28statistics%29</a> </p>      <p><a href="http://doi.acm.org/10.1145/1102351.1102456">http://doi.acm.org/10.1145/1102351.1102456</a> </p>      <p><a href="http://www.ai.mit.edu/projects/jmlr/papers/volume3/scheffer02a/scheffer02a.pdf">http://www.ai.mit.edu/projects/jmlr/papers/volume3/scheffer02a/scheffer02a.pdf</a> </p>      <p><a href="http://www.uiah.fi/projects/metodi/152.htm">http://www.uiah.fi/projects/metodi/152.htm</a> </p>      <p><a href="http://en.wikipedia.org/wiki/Quantitative_marketing_research">http://en.wikipedia.org/wiki/Quantitative_marketing_research</a> </p>      <p><a href="http://en.wikipedia.org/wiki/Expectation-maximization_algorithm">http://en.wikipedia.org/wiki/Expectation-maximization_algorithm</a> </p>      <p><a href="http://msdn.microsoft.com/en-us/library/EM_Algorithm">http://www.gabormelli.com/RKB/EM_Algorithm</a></p>   </li> </ol>  <p><strong>Authors</strong> </p>  <p>Raj Kamal (<strong><a href="mailto:rajkamal@microsoft.com">rajkamal</a></strong>) </p>]]></content:encoded>
    </item>
    <item>
      <title>Web Services Test Automation Guidance using VS 2010 - Unit Test &amp; Web Test (Documentation)</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/web-services-test-automation-guidance-using-vs-2010-unit-test-web-test-documentation</link>
      <pubDate>Sat, 10 Dec 2011 16:34:18 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2011/12/10/web-services-test-automation-guidance-using-vs-2010-unit-test-web-test-documentation/</guid>
      <description><![CDATA[For all deliverables &amp; details: http://webservicestesting.codeplex.com     Authors   Raj...]]></description>
      <content:encoded><![CDATA[<blockquote>   <p><strong><em></em></strong></p>    <p><strong><em>For all deliverables &amp; details: </em></strong><a title="http://webservicestesting.codeplex.com" href="http://webservicestesting.codeplex.com"><strong><em>http://webservicestesting.codeplex.com</em></strong></a></p> </blockquote>  <p><strong></strong></p>  <p><strong>Authors</strong> </p>  <p>Raj Kamal (<a href="mailto:rajkamal@microsoft.com">rajkamal@microsoft.com</a>) , </p>  <p>Vipul Mehta (<a href="mailto:vmehta@microsoft.com">vmehta@microsoft.com</a> ) , </p>  <p>Ranjit Gupta (<a href="mailto:rankumar@microsoft.com">rankumar@microsoft.com</a> ) </p>  <p>Gunjan Jain (<a href="mailto:gunjain@microsoft.com">gunjain@microsoft.com</a> ) </p>  <p>Microsoft Services - Global Delivery, India </p>  <p><a name="_Toc284684658"></a>&#160;&#160;&#160; </p>  <h3></h3>  <h3><a name="_Toc311287822">Objective</a></h3>  <p>This artifact will provide <b><i>Web Services Automation guidance for Functional &amp; Performance Testing leveraging VS 2010</i></b><i>. </i>The document will provide recommendation on using either <i>Unit Test or Web Test</i> for functional testing depending on your project and test objective as will be later covered in the document. <i>Load Test</i> will be used for <i>Performance Testing</i> in both cases. </p>  <p>The primary objective is to propose a viable web services test automation approach &amp; reusable libraries to customers, partners and consultant. It will also be a step in standardizing web services automation using <b>VS 2010</b> platform across the Industry and filling the gaps by extending our tools as suggested in the talk. The document can also be used as a quick jump start guide for beginners to get started on Web Services Automation Testing. </p>  <p>Other than the guidance included in this document, key deliverable will primarily consists of the following: </p>  <p>a) <i>Unit Test &amp; Web Test Template projects for Web services testing</i> </p>  <p><i>b)</i> <i>Reusable libraries for Unit Test </i></p>  <p><i>c) Reusable Add-ins (Extraction &amp; Validation Rules) for Web Test that can be reused to reduce automation development effort drastically.</i> </p>  <p><i>d) Performance Testing using Load Test once the Web Tests/Unit Tests are in place.</i></p>  <p><i>e) Sample Web Services application for beginners to gets started</i> </p>  <p>   <table cellspacing="0" cellpadding="0"><tbody>       <tr>         <td>           <p><font size="4"><b>Pre-requisites:</b> </font></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6505.clip_image001_1C296A7F.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6505.clip_5F00_image001_5F00_1C296A7F.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4540.clip_image001_thumb_772BAA05.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4540.clip_5F00_image001_5F00_thumb_5F00_772BAA05.gif" width="15" height="15" /></a> Ensure you have downloaded and deployed<i> </i><b>WebServiceAutomation_SampleApp</b><b> </b>that contains sample Web services projects (WCF/ASMX/WF etc.) that you can use to getting started with Web Services automation. <i></i></p>            <p><i></i></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4530.clip_image0011_0FBB4756.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4530.clip_5F00_image0011_5F00_0FBB4756.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[1]" border="0" alt="clip_image001[1]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8233.clip_image0011_thumb_0EE2E16C.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8233.clip_5F00_image0011_5F00_thumb_5F00_0EE2E16C.gif" width="15" height="15" /></a> Verify you have downloaded our sample Template projects <b>WebServiceAutomation_SampleUnitTest and WebServiceAutomation_SampleWebTest </b>that contain sample unit test/web test which you can reuse / customize for your needs </p>            <p><i></i></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4530.clip_image0012_27064BC7.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4530.clip_5F00_image0012_5F00_27064BC7.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[2]" border="0" alt="clip_image001[2]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5428.clip_image0012_thumb_54876B8A.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5428.clip_5F00_image0012_5F00_thumb_5F00_54876B8A.gif" width="15" height="15" /></a> Ensure you have downloaded our Reusable Libraries for Unit Testing<b> (WebServicesTesting.Automation.UnitTest.Helper.dll) </b>&amp; Web Test<b> (WebServicesTesting.Automation.WebTest.Helper.dll)</b> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7288.clip_image0013_53AF05A0.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7288.clip_5F00_image0013_5F00_53AF05A0.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[3]" border="0" alt="clip_image001[3]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6014.clip_image0013_thumb_52D69FB6.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6014.clip_5F00_image0013_5F00_thumb_5F00_52D69FB6.gif" width="15" height="15" /></a> Visual Studio 2010, SQL Server Express or higher version, IIS (Internet Information Server 6.0 or above</p>         </td>       </tr>     </tbody></table> </p>  <p>&#160;</p>  <p><i></i></p>  <p><i></i></p>  <p><i></i></p>  <p><i></i></p>  <p><i></i></p>  <p><a name="_Toc284684660"></a><a name="_Case_Study"></a></p>  <h3><a name="_Toc311287823"></a></h3>  <h3>Importance of Web Service Automation</h3>  <p>It’s important to first understand the importance of Web Services Automation and the ideal scenarios where it must be recommended. </p>  <p>Web Services (WCF/ASMX) due to their worldwide implementation and popularity but limited test tool support, often raises the question around testing them effectively. Testers are craving to find effective ways to Test Web Services. Even VS 2010 doesn’t have dedicated test types for verifying Web Services (<i>like for UI, there is Coded UI and for DB there is Database Unit Test</i>) which results in low test coverage and non-standardization of proven ways to test web services especially WCF 4.0 Web Services. Web Services Testing in VS 2010 so far has been not been given a first-class citizen treatment and this guidance will bridge that gap by making it much easier and effective. </p>  <p>· In this agile development era, we are moving to a model where UI is ever changing and consummation of web services is taking the center stage and hence this layer attention it truly deserves by shifting the onus from UI testing to Web Services based validation. </p>  <p>Traditionally teams have also used Fiddler and other 3<sup>rd</sup> Party tools for the same purpose (<i>many times for manual testing alone</i>) but as Web services have different needs, the knowledge harvested doesn’t get reused to its potential in future engagements </p>  <h3>&#160;</h3>  <h3><a name="_Toc311287824">Ideal Candidates</a></h3>  <p>· If your application is consuming APIs exposed by other upstream systems or 3rd Parties </p>  <p>· If your application is exposing APIs to be consumed by the downstream applications </p>  <p>· When your UI is dynamic and constantly changing and cost/maintenance of UI automation is much more. </p>  <p>· When your business logic and rules are primarily implemented using services (ASMX, WCF &amp; Workflow Services) and testing at this layer is much faster and efficient. </p>  <p>· When you need to come up with a common automation framework for web services that can be used to validate both functional and performance aspect of the web services with minimum effort. </p>  <h3><a name="_Toc311287825"></a><a name="_Test_Approach_–"></a>&#160;</h3>  <h3>Test Approach – Identify your goal (Functional Test or Performance Test or Both)</h3>  <p>When we understand and realize the importance of Web Services Automation, the next challenge is to select the right Test approach and Test Type before jumping into automation design and implementation. </p>  <h4>&#160;</h4>  <h4><a name="_Toc311287826"><font color="#000000" size="4" face="Arial">Test Objective</font></a></h4>  <p>It is important to answer the basic question “<i>Why do you want to do Web Services Testing?”</i> and that will help you decide the right kind of Test you should choose to automate them. Let’s begin with few possible answers </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5123.clip_image0014_6B663D06.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5123.clip_5F00_image0014_5F00_6B663D06.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[4]" border="0" alt="clip_image001[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4848.clip_image0014_thumb_6A8DD71C.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4848.clip_5F00_image0014_5F00_thumb_5F00_6A8DD71C.gif" width="15" height="15" /></a> <i>To validate the functional behavior of your application / APIs</i> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0333.clip_image0015_553021B4.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0333.clip_5F00_image0015_5F00_553021B4.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[5]" border="0" alt="clip_image001[5]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1222.clip_image0015_thumb_5457BBCA.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1222.clip_5F00_image0015_5F00_thumb_5F00_5457BBCA.gif" width="15" height="15" /></a> <i>To validate the performance aspect of your application/ APIs</i> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1212.clip_image0016_537F55E0.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1212.clip_5F00_image0016_5F00_537F55E0.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[6]" border="0" alt="clip_image001[6]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6505.clip_image0016_thumb_52A6EFF6.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6505.clip_5F00_image0016_5F00_thumb_5F00_52A6EFF6.gif" width="15" height="15" /></a> <i>To first validate the functionality and then also test the performance aspect of it. (a) + (b)</i> </p>  <p>Now when you know about your test objective, you should also look at the technologies being used for your Web Services as that can make a difference as well. If you use Microsoft platform, chances are your services are built on: </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4861.clip_image0017_51CE8A0C.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4861.clip_5F00_image0017_5F00_51CE8A0C.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[7]" border="0" alt="clip_image001[7]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8255.clip_image0017_thumb_65E7A695.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8255.clip_5F00_image0017_5F00_thumb_5F00_65E7A695.gif" width="15" height="15" /></a> <i>ASMX – Legacy aps </i></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0245.clip_image0018_650F40AB.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0245.clip_5F00_image0018_5F00_650F40AB.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[8]" border="0" alt="clip_image001[8]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7510.clip_image0018_thumb_6436DAC1.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7510.clip_5F00_image0018_5F00_thumb_5F00_6436DAC1.gif" width="15" height="15" /></a> <i>WCF – New apps </i></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6518.clip_image0019_635E74D7.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6518.clip_5F00_image0019_5F00_635E74D7.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[9]" border="0" alt="clip_image001[9]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6507.clip_image0019_thumb_62860EED.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6507.clip_5F00_image0019_5F00_thumb_5F00_62860EED.gif" width="15" height="15" /></a> <i>WF – Window Workflow Foundation</i> </p>  <h4>&#160;</h4>  <h4><a name="_Toc311287827"><font color="#000000" size="4" face="Arial">Choosing the appropriate Test Type (Unit Test or Web Test)</font></a></h4>  <p>Please find below the recommendation on the type of test you should decide depending on your test objective defined in the section above </p>  <p><b>Unit Test</b> – provides you with flexibility to directly access your Web services APIs programmatically using familiar c# and test their behaviour based on your requirements, business rules etc. <i>We will be </i><a href="file:///C:/Users/rajkamal/Documents/#_Web_Services_Automation"><i>covering</i></a><i> this in depth in the section below</i> </p>  <p><b>Web Test –</b> also lets you invoke your web services methods, though not through better known record and playback feature of Web Test but by directly adding services method call and parameters, properties. <i>We will be </i><a href="file:///C:/Users/rajkamal/Documents/#_Web_Services_Automation_1"><i>covering</i></a><i> this in depth in the section below</i> </p>  <p>At a high level, you can say that unit test is more of glass box testing whereas Web Test gives you ‘black box’ view. </p>  <p>As shown in the image below, <b>Unit Test</b> is an <b>excellent</b> choice when: </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2804.clip_image00110_7AA97948.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2804.clip_5F00_image00110_5F00_7AA97948.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[10]" border="0" alt="clip_image001[10]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0160.clip_image00110_thumb_282A990C.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0160.clip_5F00_image00110_5F00_thumb_5F00_282A990C.gif" width="15" height="15" /></a> You have complex web services involving lot of business rules and logic which you need to validate and primary focus is on detailed functional validation </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5554.clip_image00111_7964E069.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5554.clip_5F00_image00111_5F00_7964E069.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[11]" border="0" alt="clip_image001[11]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7181.clip_image00111_thumb_788C7A7F.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7181.clip_5F00_image00111_5F00_thumb_5F00_788C7A7F.gif" width="15" height="15" /></a> You are using WCF based services that includes RESTFul API, services returning non-xml kind of data </p>  <p><b>Web Test</b> is a <b>better</b> choice when: </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0763.clip_image00112_77B41495.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0763.clip_5F00_image00112_5F00_77B41495.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[12]" border="0" alt="clip_image001[12]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2311.clip_image00112_thumb_25353459.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2311.clip_5F00_image00112_5F00_thumb_5F00_25353459.gif" width="15" height="15" /></a> You have relatively simpler web services where you objective is to test simpler / straightforward functionality and behaviour and primary focus is to test their performance down the line </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4073.clip_image00113_766F7BB6.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4073.clip_5F00_image00113_5F00_766F7BB6.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[13]" border="0" alt="clip_image001[13]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4863.clip_image00113_thumb_0EFF1907.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4863.clip_5F00_image00113_5F00_thumb_5F00_0EFF1907.gif" width="15" height="15" /></a> You are working on legacy app that are based on ASMX kind of services which have a better support in Web Test </p>  <p><i></i></p>  <p><i><u></u></i>&#160; </p>  <p><i><u></u></i>&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0576.image_0E26B31D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0576.image_5F00_0E26B31D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7610.image_thumb_6928F2A3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7610.image_5F00_thumb_5F00_6928F2A3.png" width="626" height="326" /></a> </p>  <blockquote>   <p align="center"><i><u>Test Types vs. Test Objective Recommendation</u></i><u></u> </p> </blockquote>  <h3>&#160;</h3>  <h3>&#160; </h3>  <h3><a name="_Toc311287828">Sample Lab Application: Web Service Automation</a></h3>  <p><a name="_Walkthrough:_Identifying_Automation"></a>As many of you might be new to Web Services automation, we have created and shared sample Web Services applications that will help you better understand our helper functions/ Add-ins and sample unit test/web test shown later in the document. </p>  <p>If you already have sample Web Services deployed in your machine, you can skip this section. </p>  <p>   <table cellspacing="0" cellpadding="0"><tbody>       <tr>         <td>           <p><b>Sample Application: Student Administration</b> </p>            <p>This is a sample <b>Student Administration</b> application that comprises of simple functionalities around enrolling students and displaying their details back to the user. The UI app is built using Win forms and services are implemented using both ASMX and WCF for demonstration purpose. There are other sample projects to demonstrate features like Authentication, Caching, Workflow, Asynchronous calling etc.</p>         </td>       </tr>     </tbody></table> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1323.image_07'98.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1323.image_5F00_07270098.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4807.image_thumb_167A62A7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4807.image_5F00_thumb_5F00_167A62A7.png" width="693" height="464" /></a> </p>  <p><i>Sample Student Administration Application UI</i> </p>  <p>&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3718.image_570C8949.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3718.image_5F00_570C8949.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1777.image_thumb_5CE72CE2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1777.image_5F00_thumb_5F00_5CE72CE2.png" width="361" height="310" /></a> </p>  <p><i>Sample Application project structure in TFS</i> </p>  <p>Please refer to <a href="file:///C:/Users/rajkamal/Documents/#_Deploying_Sample_Web">Appendix: Deploying Sample Web Services Application</a> to know more about our sample application and instructions around deployment. </p>  <p>At this point we assume you have deployed our sample web services application. In subsequent sections, we will present the various approaches and steps involved in <b>Web Services </b><b>Automation Design, Development &amp; Execution </b>that you should take to achieve your objective while following the automation standards and guidelines that are recommended. </p>  <p>&#160; </p>  <h3><a name="_Toc311287829"></a><a name="_Web_Services_Automation"></a>Web Services Automation – Unit Test Walkthrough</h3>  <p>If “<b>Unit Test</b>” was selected as the Test approach for Web service automation based on the analysis and your test objective as covered in above <a href="file:///C:/Users/rajkamal/Documents/#_Test_Approach_&ndash;">section: Test Approach </a>then proceed with the walk through. </p>  <h4><a name="_Toc311287830"></a><a name="_Walkthrough:_Creating_a"></a><a name="_Step_3:_Automation"></a><font color="#000000" size="4" face="Arial"></font>&#160;</h4>  <h4><font color="#000000" size="4" face="Arial">Creating a new Unit Test Project / Reusing Sample Template Unit Test Project</font></h4>  <p><a name="_Walkthrough:_Designing_automation"></a>You can create a new project from scratch or using our existing sample template project but it’s important to add your project to source control for version management and change tracking. </p>  <p>   <table border="1" cellspacing="0" cellpadding="0" width="838"><tbody>       <tr>         <td valign="top" width="36">           <p>SL No.</p>         </td>          <td valign="top" width="130">           <p>Topics</p>         </td>          <td valign="top" width="670">           <p>Description</p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>1. </p>         </td>          <td valign="top" width="130">           <p>Have you identified &amp; marked the automatable tests as PLANNED in Microsoft Test Manager (MTM)</p>         </td>          <td valign="top" width="670">           <p>Open your test cases in Test Manager that you want to automate and mark Automation Status = “Planned” for those </p>            <p>&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5700.image_57D4C966.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5700.image_5F00_57D4C966.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1185.image_thumb_1A6464DF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1185.image_5F00_thumb_5F00_1A6464DF.png" width="413" height="280" /></a> </p>            <p><i></i></p>            <p><i>Whereas the test which are not good candidates for automation are marked as “Not Automated” to show that they are out-of-scope for automation.</i> </p>            <p>&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7140.image_539ACBD4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7140.image_5F00_539ACBD4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6888.image_thumb_7C56311D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6888.image_5F00_thumb_5F00_7C56311D.png" width="418" height="242" /></a> </p>            <p>This is an <i>optional</i> step if you don’t want to run your test from Microsoft Test Manager and map your automation to manual test cases. We however recommend this.</p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>2. a</p>         </td>          <td valign="top" width="130">           <p>Have you created new Test project &amp; Added it to Source Control (TFS)? </p>            <p><i></i></p>            <p><i></i></p>         </td>          <td valign="top" width="670">           <p>&#160; </p>            <p>Every automation project must be source controlled. </p>            <p>&#160;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8055.image_6B41DD6D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8055.image_5F00_6B41DD6D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0647.image_thumb_593599E0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0647.image_5F00_thumb_5F00_593599E0.png" width="414" height="373" /></a> </p>            <p><i>Add project to Source Control by clicking the check box as shown and give appropriate name.</i></p>            <p><em></em>&#160;</p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>2.b</p>         </td>          <td valign="top" width="130">           <p>Alternatively, </p>            <p>Open existing Test project and using it as Template</p>         </td>          <td valign="top" width="670">           <p>&#160; </p>            <p>Launch Visual Studio, Browse and open existing <b>‘WebServiceAutomation_SampleUnitTest’ </b>template project and add it to Source control. You can change the properties as per your needs. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7080.image_6914B8D7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7080.image_5F00_6914B8D7.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0045.image_thumb_166628DB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0045.image_5F00_thumb_5F00_166628DB.png" width="259" height="402" /></a> </p>            <p>For this sample template project we have <b>SampleUnitTestCases.cs</b> that contains all our sample reusable unit test cases. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0160.image_03817F64.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0160.image_5F00_03817F64.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0842.image_thumb_156D7757.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0842.image_5F00_thumb_5F00_156D7757.png" width="532" height="456" /></a> </p>            <p>Please find below a short description on the folder structure of the template project which will be used for case study: </p>            <p>1. <b>Config</b>: All your application configuration details that you need to run your test will go to app.config </p>            <p>Example: </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3731.image_415A02E1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3731.image_5F00_415A02E1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1425.image_thumb_2B901A84.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1425.image_5F00_thumb_5F00_2B901A84.png" width="341" height="73" /></a> </p>            <p>Also refer to: <a href="http://msdn.microsoft.com/en-us/library/a65txexh(v=VS.100).aspx">http://msdn.microsoft.com/en-us/library/a65txexh(v=VS.100).aspx</a> </p>            <p><b>2. </b><b>Common Libraries References: </b>Add references to our reusable helper library <b>“WebServicesTesting.Automation.UnitTest.Helper.dll”</b> for Unit Test Web Services Testing <i>(provided as part of the release and </i><a href="file:///C:/Users/rajkamal/Documents/#_Web_Service_Performance"><i>documented</i></a><i> below</i>)<b> </b></p>            <p><b></b></p>            <p>.<b></b> <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3162.image_49FA5B6D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3162.image_5F00_49FA5B6D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3162.image_thumb_7486167D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3162.image_5F00_thumb_5F00_7486167D.png" width="472" height="402" /></a> </p>            <p><b>3. </b><b>Service References: </b>Add / update services reference to point to your web services and provide a logical name<b></b> </p>            <p>&#160; </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8880.image_61353A11.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8880.image_5F00_61353A11.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6330.image_thumb_328F0B62.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6330.image_5F00_thumb_5F00_328F0B62.png" width="490" height="423" /></a> </p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p><b>4. </b><b>Scripts: </b>Your actual test are stored in these .cs files along with components like Test Initialize, Test Cleanup etc<b></b> </p>            <p>You can create a folder structure to organize your test methods by grouping them in multiple class files depending on the size of the project. It is advisable to group test belonging to same feature/functional module to be grouped together in a .CS file and given an appropriate name. </p>            <p><b>5. </b><b>Solution Configurations &amp; Compilation Symbols</b> </p>            <p>With our template solution you get additional solution configuration which will help you run your same test for both functional and load test seamlessly by controlling the sections of the code that you may want to execute for functional and load testing </p>            <p>For example. When you do load test, you might not want to do certain validation which makes sense for functional testing alone and these configurations will control that by just selecting the appropriate solution configuration as shown below. </p>            <p>a) Custom Solution configurations </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0385.clip_image002_7D725664.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0385.clip_5F00_image002_5F00_7D725664.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7725.clip_image002_thumb_1595C0C0.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7725.clip_5F00_image002_5F00_thumb_5F00_1595C0C0.jpg" width="391" height="217" /></a> </p>            <p>b) Configuration – Functional Testing </p>            <p>As shown below it uses a compilation symbol #<b>WEBSERVICES_FUNCTIONAL_TESTING </b>that is used in our test methods to control the behavior. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7416.image_6FBF9A5C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7416.image_5F00_6FBF9A5C.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2538.image_thumb_31E302E0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2538.image_5F00_thumb_5F00_31E302E0.png" width="406" height="146" /></a> </p>            <p>c) Inside your test method, you will have code like this to control the behavior based on the solution configuration file that is selected </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5684.image_6321C773.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5684.image_5F00_6321C773.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1057.image_thumb_4D57DF16.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1057.image_5F00_thumb_5F00_4D57DF16.png" width="403" height="107" /></a> </p>            <p>For more reference: </p>            <p><a href="http://www.codeproject.com/Articles/49448/Use-Visual-Studio-Conditional-Compilation-to-manag.aspx">http://www.codeproject.com/Articles/49448/Use-Visual-Studio-Conditional-Compilation-to-manag.aspx</a></p>         </td>       </tr>     </tbody></table> </p>  <h4></h4>  <h4></h4>  <h4>&#160;</h4>  <h4><a name="_Toc311287831"><font color="#000000" size="4" face="Arial">Unit Test Automation Design &amp; Development (WCF &amp; ASMX based services)</font></a></h4>  <p>Now that you have your test project in place and our sample reusable unit test cases for automating common web services test scenario, in this section we will be walking you through few sample reusable tests that you can customize it for your own needs or create new unit test for your project scope. The approach shown below would remain same for WCF as well as ASMX based services and we have shown examples of both. </p>  <p>Follow the below steps for Automation design guidance:</p>  <p>&#160;</p>  <p>   <table border="1" cellspacing="0" cellpadding="0" width="849"><tbody>       <tr>         <td valign="top" width="39">           <p><b></b>SL No.</p>         </td>          <td valign="top" width="129">           <p>Steps</p>         </td>          <td valign="top" width="679">           <p>Description</p>         </td>       </tr>        <tr>         <td valign="top" width="39">           <p>1.</p>         </td>          <td valign="top" width="129">           <p>Global Settings</p>         </td>          <td valign="top" width="679">           <p>&#160; </p>            <p>a) Set the test context which provides information about and functionality for the current test run. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8233.image_609895B5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8233.image_5F00_609895B5.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4201.image_thumb_5FC02FCB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4201.image_5F00_thumb_5F00_5FC02FCB.png" width="325" height="211" /></a> </p>            <p>b) <b>Test Initialize:</b> To perform steps before running each test like instantiating objects, defining global variables including connection strings etc. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0003.image_659AD364.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0003.image_5F00_659AD364.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6366.image_thumb_032CAE64.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6366.image_5F00_thumb_5F00_032CAE64.png" width="387" height="157" /></a> </p>            <p>c) <b>Test Cleanup:</b> To run code after running each steps</p>         </td>       </tr>        <tr>         <td valign="top" width="39">           <p>2a. </p>         </td>          <td valign="top" width="129">           <p>Add New Test Methods / Reuse Existing Template Test Methods </p>            <p><b>(Simple Lookup Verification)</b> </p>            <p><b></b></p>            <p><b></b></p>         </td>          <td valign="top" width="679">           <p><b><i></i></b>&#160; </p>            <p><b><i>Sample T</i></b><b>est<i> scenario</i>: Verifying Web service call response value against expected results </b></p>            <p>Below is sample data driven test method for web services testing that comes with our template project for Unit Test. You can add your new test methods by modeling the below example. </p>            <p>Step 1. </p>            <p>Create a new Test method / Modify our existing sample test method </p>            <p>Step 2. </p>            <p>Instantiate and invoke your web service method (<i>in this example: ASMX based service</i>) as shown in the code snippet below and get the results in a variable of appropriate data type </p>            <p>In our sample example, the web service returns an integer datatype which we cast to String for comparison. Your services method can return any data type like int, double, decimal, bool, string etc and we can use the same helper method below to validate the response. </p>            <p>Step 3. </p>            <p>Get your expected results from data source of your choice as shown below. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3146.image_322EEA3B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3146.image_5F00_322EEA3B.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6278.image_thumb_1C848BD1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6278.image_5F00_thumb_5F00_1C848BD1.png" width="518" height="341" /></a> </p>            <p>Step 4. </p>            <p><i>Reuse our appropriate library / helper method for validating the web service response against expected results. </i></p>            <p>In this example <a href="file:///C:/Users/rajkamal/Documents/#_Web_Services_Test"><b>CompareString</b></a> is a reusable method in our helper / library that can be called from your test methods to save effort related to validating the results and marking the test as <i>pass/fail</i>. </p>            <p><i>Note: Depending on your test scenario, you need to choose different helper/library methods. The </i><a href="file:///C:/Users/rajkamal/Documents/#_Web_Services_Test"><i>complete documentation about our reusable library method is given in sections below</i></a></p>            <p><i></i>&#160;</p>         </td>       </tr>        <tr>         <td valign="top" width="39">           <p><b></b></p>            <p>2b<b></b></p>         </td>          <td valign="top" width="129">           <p>Add New Test Methods / Reuse Existing Template Test Methods </p>            <p><b>(Simple Transactions Verification)</b></p>         </td>          <td valign="top" width="679">           <p><b><i></i></b>&#160; </p>            <p><b><i>Sample T</i></b><b>est<i> scenario</i>: Verifying Web service call results in database operation like Insert</b> </p>            <p>Below is sample test method when tester needs to validate if the web service call results into a Database Insert by validating the database for ensuring the transaction was committed. Instead of Insert, you might have different operations like update, delete etc. for which we have <a href="file:///C:/Users/rajkamal/Documents/#_Web_Services_Test">reusable helper methods in our library</a>. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5224.image_75A64FC3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5224.image_5F00_75A64FC3.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1423.image_thumb_5DBF689D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1423.image_5F00_thumb_5F00_5DBF689D.png" width="564" height="382" /></a> </p>            <p>Here the web service method <i>Enroll_Student (in this case WCF based Service)</i> is inserting a record into the database and the expected result is the query against the database to validate the operation to ensure transaction was committed. </p>            <p><i>Reuse our appropriate library / helper method for validating the web service response against expected results. </i></p>            <p>In this example <a href="file:///C:/Users/rajkamal/Documents/#_Web_Services_Test"><b>Verify_DBInsert</b></a> is a reusable method in our helper / library that can be called from your test methods to save effort related to validating the database insert and marking the test as <i>pass/fail</i>. </p>            <p><i>Note: Depending on your test scenario, you need to choose different helper/library methods. The </i><a href="file:///C:/Users/rajkamal/Documents/#_Web_Services_Test"><i>complete documentation about our reusable library method is given in sections below</i></a></p>            <p><i></i>&#160;</p>         </td>       </tr>        <tr>         <td valign="top" width="39">           <p><b></b></p>            <p>2c<b></b></p>         </td>          <td valign="top" width="129">           <p>Add New Test Methods / Reuse Existing Template Test Methods </p>            <p><b>(Handling Complex Object Types)</b><b></b></p>         </td>          <td valign="top" width="679">           <p><i></i></p>            <p><i></i>&#160; </p>            <p><i>Use this approach as a generic way of comparing / validating web services response of various data types including user defined/abstract data types like Struct, Classes as well as primitive data types like Int, String, Dictionary, List etc.</i><i></i> </p>            <p><i></i></p>            <p><a href="http://msdn.microsoft.com/en-us/library/ff649585.aspx"><b>DTO (Data Transfer Objects)</b></a><b> </b>Having the results of a remote method available in an object instance makes it easy to pass this data to a test module or to compare it with the desired outcome<b></b> </p>            <p><i></i></p>            <p><i>It works by converting the service response (whether abstract or primitive data types) and expected results into standard generic objects which then are finally converted into XML for comparison with the help of our reusable library methods as described below in the example</i> </p>            <p><i></i></p>            <p><b><i>Sample T</i></b><b>est<i> scenario</i>: Verifying Web service response which returns a Struct object against test data from database.</b> </p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p>Step 1: Create <i>Data structure</i> for your object which your service returns as </p>            <p>shown below </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0755.image_5623D363.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0755.image_5F00_5623D363.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2746.image_thumb_799051FB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2746.image_5F00_thumb_5F00_799051FB.png" width="533" height="416" /></a> </p>            <p>(<i>In this case it returns a Struct which contain elements like</i> </p>            <p><i>First_Name, Last_Name etc.</i> </p>            <p>Step 2. This is an optional step for better organizing your code which invoked your web services and returns the response to the main test method for verification. </p>            <p><b></b></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6153.image_1E3143A6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6153.image_5F00_1E3143A6.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4034.image_thumb_064A5C80.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4034.image_5F00_thumb_5F00_064A5C80.png" width="563" height="339" /></a> </p>            <p>Step 3: Add your test method </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4846.image_781B47B5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4846.image_5F00_781B47B5.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2313.image_thumb_744D7D18.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2313.image_5F00_thumb_5F00_744D7D18.png" width="562" height="332" /></a> </p>            <p>Step 4. You can read your data source (in this case database) and convert it into generic DTO object using reusable method in our library called <b>DTO_PopulateDBResults</b> which takes Dataset as input parameter. DTO Type should be same as the type of your complex object <i>(in this case Student which is struct)</i> </p>            <p><i>List</i><i>&lt;Student&gt; ExpectedStudentDTOList = null;</i> </p>            <p><i>ExpectedStudentDTOList = helper.DTO_PopulateDBResults&lt;Student&gt;(dt);</i> </p>            <p>Step 5. In this step you call you Action code to get your web service response </p>            <p>Actions.DTO_Action complexObj = new Actions.DTO_Action(); </p>            <p>Object myObj = complexObj.ComplexObjectSample(); </p>            <p>Step 6. Convert web services response into generic DTO using our generic library method called <b>DTO_PopulateObject</b> which accepts Object and structure of the object defined above as parameters. </p>            <p>object ActualStudentDTOList = helper.DTO_PopulateObject&lt;Student&gt;(myObj, s1); </p>            <p>Step 7. Finally the generic DTO objects returned from expected results i.e. Test data source and Web services response are converted into XML and compared using our reusable library method called DTO_XMLComparison and accordingly marks the test method as pass/fail </p>            <p>bool result = helper.DTO_XmlComparison(ExpectedStudentDTOList, ActualStudentDTOList, typeof(List&lt;Student&gt;)); </p>            <p>Assert.AreEqual(true, result, &quot;Expected does not match actual&quot;); </p>            <p>Step 8. Expected and Actual XML files with the test method name are created under your folder <b>c:\TestResults </b>for your future reference. Please create this folder if it doesn’t exist</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4786.image_2417F90D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4786.image_5F00_2417F90D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0753.image_thumb_630979A8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0753.image_5F00_thumb_5F00_630979A8.png" width="548" height="181" /></a></p>         </td>       </tr>        <tr>         <td valign="top" width="39">           <p><b></b></p>            <p><b></b></p>            <p>3<b>. </b></p>            <p><b></b></p>         </td>          <td valign="top" width="129">           <p>Make your scripts data-driven </p>            <p>Irrespective of kind of test methods you have created above</p>         </td>          <td valign="top" width="679">           <p><b>Data-Driven Test</b> </p>            <p>Ensure every variable is parameterized by passing the test data to each test using data-driven capabilities in VS 2010. </p>            <p><i>Right-click on the test method and select Properties, to view the properties of the test</i> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6457.image_6AF0F63D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6457.image_5F00_6AF0F63D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5305.image_thumb_21EAD477.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5305.image_5F00_thumb_5F00_21EAD477.png" width="382" height="306" /></a> </p>            <p>To start making this a data-driven test, we have to first create a data source for the test to draw from. On the Data Connection String property, click the ellipse button to start the New Test Data Source Wizard </p>            <p>There are three options for creating a data source: </p>            <p><b>Database</b> -- which allows you to connect to a database or Microsoft Excel spreadsheet </p>            <p><b>CSV</b> File -- which allows you to use a comma-delimited file </p>            <p><b>XML</b> File -- which allows you to use an XML file </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5808.image_32CEB6C0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5808.image_5F00_32CEB6C0.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4760.image_thumb_5C15D8F1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4760.image_5F00_thumb_5F00_5C15D8F1.png" width="324" height="310" /></a> </p>            <p>When you add a data source A Data Source attribute is added to the Test method. </p>            <p>[DataSource(&quot;System.Data.SqlClient&quot;, &quot;Data Source=(local);Initial Catalog=Sample_DB;Integrated Security=True&quot;, &quot;Sample_App&quot;, DataAccessMethod.Sequential), TestMethod]</p>         </td>       </tr>        <tr>         <td valign="top" width="39">           <p>4.</p>         </td>          <td valign="top" width="129">           <p>Map your automation test to your test cases in MTM</p>         </td>          <td valign="top" width="679">           <p>&#160;</p>            <p>This is an <i>optional</i> step if you don’t want to run your test from Microsoft Test Manager and <a href="http://msdn.microsoft.com/en-us/library/dd380741.aspx">map your automation unit test to manual test cases</a>. We however recommend this.</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8562.image_36B8B8F8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8562.image_5F00_36B8B8F8.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2627.image_thumb_1AC78400.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2627.image_5F00_thumb_5F00_1AC78400.png" width="515" height="438" /></a></p>         </td>       </tr>     </tbody></table> </p>  <p>Repeat the above steps for all your test scenarios against your web services to be tested. After you write and debug your scripts its important to run them in a batch or as part of a suite. There are various way to do that and factors to keep in mind as we will see in next section. </p>  <p>&#160; </p>  <h3><a name="_Toc311287832"></a><a name="_Web_Services_Automation_1"></a>Web Services Automation – Web Test Walkthrough</h3>  <p>If “<b><i>Web Test</i>”</b> was selected as the Test approach for Web service automation based on the analysis and your test objective as covered in above <a href="file:///C:/Users/rajkamal/Documents/#_Test_Approach_&ndash;">section: Test Approach </a>then proceed with the walk through. </p>  <h4>&#160;</h4>  <h4><a name="_Toc311287833"><font color="#000000" size="4" face="Arial">Creating a new Web Test Project / Reusing Template Web Test Project</font></a></h4>  <p>You can create a new project from scratch or using our existing sample template project but it’s important to add your project to source control for version management and change tracking. </p>  <p>   <table border="1" cellspacing="0" cellpadding="0" width="816"><tbody>       <tr>         <td valign="top" width="36">           <p>SL No.</p>         </td>          <td valign="top" width="169">           <p>Topics</p>         </td>          <td valign="top" width="609">           <p>Description</p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>1.</p>         </td>          <td valign="top" width="169">           <p>Have you created new Test project &amp; Added it to Source Control (TFS)? </p>            <p><i></i></p>            <p><i></i></p>         </td>          <td valign="top" width="609">           <p>Every automation project must be source controlled. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4606.image_5A1511C3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4606.image_5F00_5A1511C3.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2577.image_thumb_0F5E2429.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2577.image_5F00_thumb_5F00_0F5E2429.png" width="491" height="462" /></a> </p>            <p><i>Add project to Source Control by clicking the check box as shown</i></p>            <p><em></em>&#160;</p>         </td>       </tr>        <tr>         <td valign="top" width="36">           <p>2.</p>         </td>          <td valign="top" width="169">           <p>Alternatively, </p>            <p>Open existing Test project and using it as Template</p>         </td>          <td valign="top" width="609">           <p>&#160; </p>            <p>Launch Visual Studio, Browse and open existing <b>“</b> <b>WebServiceAutomation_SampleWebTest” </b>template project and add it to Source control. You can change the properties as per your needs. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3125.image_56A3544E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3125.image_5F00_56A3544E.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5381.image_thumb_6E5A8BB4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5381.image_5F00_thumb_5F00_6E5A8BB4.png" width="231" height="451" /></a> </p>            <p>Please find below a short description on the folder structure of the template project which will be used for case study: </p>            <p><b>1. </b><b>Common Libraries References: </b></p>            <p>a) Add references to our reusable helper library <b>“WebServicesTesting.Automation.WebTest.Helper.dll”</b> for WebTest based Web Services Testing <i>(provided as part of the release and </i><a href="file:///C:/Users/rajkamal/Documents/#_Web_Service_Performance"><i>documented</i></a><i> below</i>) </p>            <p><b></b></p>            <p>.<b></b> <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4130.image_6F22CBD1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4130.image_5F00_6F22CBD1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0028.image_thumb_76EABE73.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0028.image_5F00_thumb_5F00_76EABE73.png" width="464" height="382" /></a> </p>            <p><b></b></p>            <p><b>b) </b><b>Reusable Validation Rules</b> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1031.image_25A05149.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1031.image_5F00_25A05149.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8802.image_thumb_208DEDCD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8802.image_5F00_thumb_5F00_208DEDCD.png" width="481" height="350" /></a> </p>            <p><b></b></p>            <p><b>c) </b><b>Reusable Extraction Rules</b> </p>            <p><b></b></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3122.image_2730D183.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3122.image_5F00_2730D183.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6685.image_thumb_353F9AB3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6685.image_5F00_thumb_5F00_353F9AB3.png" width="479" height="354" /></a> </p>            <p><b>2. </b><b>Service References: </b>Add / update services reference to point to your web services and provide a logical name<b></b> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6204.image_3F809946.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6204.image_5F00_3F809946.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0246.image_thumb_35F7B503.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0246.image_5F00_thumb_5F00_35F7B503.png" width="432" height="362" /></a> </p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p><b>3. </b><b>Scripts: </b>Your actual test are stored in these .webtest files.<b></b> </p>            <p><b></b></p>            <p>You can create a folder structure to organize your test methods by grouping them in multiple class files depending on the size of the project. It is advisable to group test belonging to same feature/functional module to be grouped together in a .CS file and given an appropriate name. </p>            <p><i>For this sample template project we have many reusable webtest that can be reused / customized for your needs.</i> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1325.image_08D2A268.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1325.image_5F00_08D2A268.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3007.image_thumb_41D9599D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3007.image_5F00_thumb_5F00_41D9599D.png" width="460" height="340" /></a> </p>            <p><b></b></p>            <p><b>4. </b><b>Test Data: </b>You can choose to have you test data as CSV or XML or Database as support by Visual Studio Testing framework for making your test data driven. </p>         </td>       </tr>     </tbody></table> </p>  <h4></h4>  <h4>&#160;</h4>  <h4><a name="_Toc311287834"><font color="#000000" size="4" face="Arial">WebTest Automation Design &amp; Development (WCF &amp; ASMX based services)</font></a></h4>  <p>Now that you have your test project in place, in this section we will be walking you through our sample reusable <b>Web test</b> for automating common web services test scenario that you can customize it for your own needs or create new additional Web tests for your project scope. </p>  <p>Follow the below steps for Automation design guidance: </p>  <p>&#160;</p>  <p>   <table border="1" cellspacing="0" cellpadding="0" width="818"><tbody>       <tr>         <td valign="top" width="39">           <p>S No.</p>         </td>          <td valign="top" width="164">           <p>Steps</p>         </td>          <td valign="top" width="613">           <p>Description</p>         </td>       </tr>        <tr>         <td valign="top" width="39">           <p>1a.</p>         </td>          <td valign="top" width="164">           <p>Add New Web Test / Reuse Existing Template Web Test </p>            <p><b>(Dataset Verification for WCF/ ASMX Service)</b> </p>            <p><b></b></p>            <p><b></b></p>         </td>          <td valign="top" width="613">           <p><b><i></i></b>&#160; </p>            <p><b><i>Sample T</i></b><b>est<i> scenario</i>: Verifying Web service method that returns a dataset against the expected test data from Database</b> </p>            <p><b></b></p>            <p>If you are adding a new web test from scratch then follow the steps: </p>            <p>Step 1. Open your web service method request XML by launching <b>WCFTestClient</b> utility or any other way you are comfortable with. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2821.image_7ACFEB05.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2821.image_5F00_7ACFEB05.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3513.image_thumb_78B2EC3C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3513.image_5F00_thumb_5F00_78B2EC3C.png" width="560" height="159" /></a> </p>            <p>Step 2. Add a new Web Test or Reuse our existing template Web Test and customize them </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6646.image_000EABEA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6646.image_5F00_000EABEA.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7230.image_thumb_4396373F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7230.image_5F00_thumb_5F00_4396373F.png" width="507" height="262" /></a> </p>            <p>Step 3. Right click the node and press “<i>Add Web Service Request</i>” and provide your web service URL </p>            <p>&#160; </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8306.image_7D75545E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8306.image_5F00_7D75545E.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4034.image_thumb_5013BE8E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4034.image_5F00_thumb_5F00_5013BE8E.png" width="490" height="269" /></a>&#160; </p>            <p>Step 4. Right click the node and press “<i>Add Header</i>” and provide SOAPAction value as shown below by retrieving it from request XML of Step 1. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2364.image_03AC0520.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2364.image_5F00_03AC0520.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3857.image_thumb_28C94F8C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3857.image_5F00_thumb_5F00_28C94F8C.png" width="470" height="167" /></a> </p>            <p>Step 5. Add &lt;string body&gt; </p>            <p>a) From your request XML as shown below, extract Envelope and Body (you shouldn’t copy Header part) </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5826.image_3ECFBB1E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5826.image_5F00_3ECFBB1E.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7651.image_thumb_15787320.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7651.image_5F00_thumb_5F00_15787320.png" width="497" height="205" /></a> </p>            <p><i>&lt;s:Envelope xmlns:s=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;</i> </p>            <p><i>&lt;s:Body&gt;</i> </p>            <p><i>&lt;Display xmlns=&quot;http://tempuri.org/&quot; /&gt;</i> </p>            <p><i>&lt;/s:Body&gt;</i> </p>            <p><i>&lt;/s:Envelope&gt;</i> </p>            <p>b) Add this to to you string body now </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3343.image_77D67253.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3343.image_5F00_77D67253.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7587.image_thumb_677AFA9A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7587.image_5F00_thumb_5F00_677AFA9A.png" width="525" height="241" /></a> </p>            <p>Step 6. Add our reusable <b>Validation and Extraction Rule</b> called <b>DatasetValidation</b> that reads the expected data from database using SQL query and validate it against the response from web services by using XPathExpression </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1727.image_573F0CD4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1727.image_5F00_573F0CD4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0245.image_thumb_66263BEE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0245.image_5F00_thumb_5F00_66263BEE.png" width="528" height="312" /></a> </p>            <p><i>Note: Depending on your test scenario, you may need to choose different Extraction and Validation Rule </i><a href="file:///C:/Users/rajkamal/Documents/#_Web_Services_Test"><i>complete documentation about our reusable library method is given in sections below</i></a></p>            <p><i></i>&#160;</p>         </td>       </tr>        <tr>         <td valign="top" width="39">           <p>1b.</p>         </td>          <td valign="top" width="164">           <p>Add New Web Test / Reuse Existing Template Web Test </p>            <p><b>(Method Prototype Verification for WCF/ ASMX Service)</b></p>         </td>          <td valign="top" width="613">           <p><b><i>Sample T</i></b><b>est<i> scenario</i>: Verifying Web service method parameters and response values against expected test data.</b> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3884.image_3828C369.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3884.image_5F00_3828C369.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5875.image_thumb_7B441BC9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5875.image_5F00_thumb_5F00_7B441BC9.png" width="525" height="336" /></a> </p>            <p><b></b></p>            <p><b></b></p>            <p><b></b></p>            <p>Repeat Step 1 to 5 from 1 a) above as explained </p>            <p>Step 6. Add our reusable Extraction Rule called <b>ParameterExtraction </b>and provide XPathExpression for example Enroll_Student and it will retrieve all the parameters name and their respective values and store it inside ContextParam </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3005.image_4DD2602C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3005.image_5F00_4DD2602C.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1258.image_thumb_768DC575.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1258.image_5F00_thumb_5F00_768DC575.png" width="538" height="278" /></a> </p>            <p>Step 7. Step 6. Add our reusable Validation Rule called <b>ParamValidation </b>and provide <i>ParamValues</i> that contain expected test data as shown below along with contextParam name as defined in Step 6. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1258.image_455E6508.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1258.image_5F00_455E6508.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6076.image_thumb_54B1C717.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6076.image_5F00_thumb_5F00_54B1C717.png" width="539" height="310" /></a> </p>            <p>Step 8 &amp; 9. As shown in this web test you can also add our reusable <b>ServiceResponseExtraction</b> and <b>ServiceResponseValidation</b> rules from our helper class for validating the response values against expected test data. </p>            <p>Step 10. After you run this web test, the result will show Pass / Fail with context tab showing the discrepancies if any. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5481.image_66EA680C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5481.image_5F00_66EA680C.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1106.image_thumb_73781528.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1106.image_5F00_thumb_5F00_73781528.png" width="483" height="182" /></a> </p>            <p><i>Note: Depending on your test scenario, you may need to choose different helper/library methods. The </i><a href="file:///C:/Users/rajkamal/Documents/#_Web_Services_Test"><i>complete documentation about our reusable library method is given in sections below</i></a></p>            <p><i></i>&#160;</p>         </td>       </tr>        <tr>         <td valign="top" width="39">           <p><b></b></p>            <p><b></b></p>            <p>2<b>. </b></p>            <p><b></b></p>         </td>          <td valign="top" width="164">           <p>Make your scripts data-driven</p>         </td>          <td valign="top" width="613">           <p><b>Data-Driven Test</b> </p>            <p>Ensure every variable is parameterized by passing the test data to each test using data-driven capabilities in VS 2010. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7462.clip_image0025_09EAB3B0.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7462.clip_5F00_image0025_5F00_09EAB3B0.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002[5]" border="0" alt="clip_image002[5]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7462.clip_image0025_thumb_4EB6D7E4.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7462.clip_5F00_image0025_5F00_thumb_5F00_4EB6D7E4.jpg" width="406" height="350" /></a> </p>            <p>To start making this a data-driven test, we have to first create a data source for the test to draw from. On the Data Connection String property, click the ellipse button to start the New Test Data Source Wizard </p>            <p>There are three options for creating a data source: </p>            <p><b>Database</b> -- which allows you to connect to a database or Microsoft Excel spreadsheet </p>            <p><b>CSV</b> File -- which allows you to use a comma-delimited file </p>            <p><b>XML</b> File -- which allows you to use an XML file </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8130.image_72FBBC66.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8130.image_5F00_72FBBC66.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1780.image_thumb_5BED3B2A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1780.image_5F00_thumb_5F00_5BED3B2A.png" width="331" height="308" /></a></p>         </td>       </tr>     </tbody></table> </p>  <p>Repeat the above steps for all your test scenarios against your web services to be tested. After you write and debug your scripts its important to run them in a batch or as part of a suite. There are various way to do that and factors to keep in mind as we will see in next section. </p>  <h3></h3>  <h3><a name="_Toc311287835">Automation Execution &amp; Deployment (Unit Test/Web Test)</a></h3>  <p><a name="_Walkthrough:_Error_handling,"></a>Ensure you have configured test settings to capture logs, code coverage, test impact etc. and you also need to keep in mind that your script should be able to successfully run in multiple environment (for ex. Test to UAT) </p>  <p>After automation design and debugging is completed, you can now run and deploy your automation scripts using the below steps:</p>  <p>&#160;</p>  <p>   <table border="1" cellspacing="0" cellpadding="0" width="798"><tbody>       <tr>         <td valign="top" width="38">           <p>SL No.</p>         </td>          <td valign="top" width="130">           <p>Areas</p>         </td>          <td valign="top" width="628">           <p>Description</p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>1.</p>         </td>          <td valign="top" width="130">           <p><i></i></p>            <p><i>Configuring Test Settings</i> </p>            <p><i></i></p>         </td>          <td valign="top" width="628">           <p><b>Test Settings</b> </p>            <p>a) <b>Data and Diagnostic</b>: Enable appropriate diagnostic are selected as shown below (<b>Code Coverage</b>, Event Log, Test Impact etc.) </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2656.image_05A09051.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2656.image_5F00_05A09051.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1602.image_thumb_5451A5F0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1602.image_5F00_thumb_5F00_5451A5F0.png" width="549" height="317" /></a> </p>            <p>b) Define other settings like Roles, Test Timeouts, Setup and Clean scripts</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5315.image_61A79329.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5315.image_5F00_61A79329.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5327.image_thumb_2A7E0530.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5327.image_5F00_thumb_5F00_2A7E0530.png" width="539" height="307" /></a></p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>2.</p>         </td>          <td valign="top" width="130">           <p>Command Line Execution (MSTest.Exe)</p>         </td>          <td valign="top" width="628">           <p><i></i></p>            <p><b><i></i></b>&#160; </p>            <p><b><i>Grouping &amp; Classifying Test Methods using various parameters</i></b> </p>            <p><i></i></p>            <p>It lets you run groups of tests based on their assigned categories without the requirement to maintain test lists. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0121.image_486BED57.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0121.image_5F00_486BED57.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7558.image_thumb_7BC7B0B3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7558.image_5F00_thumb_5F00_7BC7B0B3.png" width="514" height="117" /></a> </p>            <p>Go to Test View and you can filter and view your tests by setting these parameters </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2275.image_7C7066DD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2275.image_5F00_7C7066DD.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0640.image_thumb_3A1D4E9A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0640.image_5F00_thumb_5F00_3A1D4E9A.png" width="376" height="187" /></a> </p>            <p><b>MSTest.EXE Options</b><b><i>: </i></b><b></b></p>            <p>MSTest.exe is the command-line command that is used to run tests. This command has several options that you can use to customize your test run. You can specify these options in any order on the MSTest.exe command line. </p>            <p>Example: </p>            <p><i>mstest /testcontainer:&quot;C:\</i> <i>WebServiceAutomation_SampleUnitTest&quot; /test:testproject32\generic </i></p>            <p>Refer to <a href="http://msdn.microsoft.com/en-us/library/ms182489.aspx">http://msdn.microsoft.com/en-us/library/ms182489.aspx</a> </p>            <p><i></i></p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>3.</p>         </td>          <td valign="top" width="130">           <p>TCM.exe or Test Execution from Microsoft Test Manager </p>            <p><i>(Optional though recommended)</i></p>         </td>          <td valign="top" width="628">           <p>&#160; </p>            <p>a) If you have mapped you automation unit test with test cases in Microsoft Test Manager then you can use TCM.exe as shown below to run your web service test and it will also update your test cases results in MTM without any custom code. You don’t need to use MSTest.exe in that case </p>            <p><i></i></p>            <p>Example: </p>            <p><i></i></p>            <p><i>tcm run /create /title:title /planid: id /collection:CollectionURL /teamproject:project (suiteid:id /configid:configid | /querytext: query) [/settingsname:name] [/owner:owner] [/builddir:directory] [/testenvironment:name] [/login:username,[password]] [/include]</i> </p>            <p><i></i></p>            <p><i>Refer to : </i><a href="http://msdn.microsoft.com/en-us/library/dd465192.aspx"><i>http://msdn.microsoft.com/en-us/library/dd465192.aspx</i></a><i> &amp; </i><a href="http://msdn.microsoft.com/en-us/library/ff942469.aspx"><i>http://msdn.microsoft.com/en-us/library/ff942469.aspx</i></a><i></i> </p>            <p><i></i></p>            <p><i></i></p>            <p>b)You can also Run Automated Tests from a Test Plan Using Microsoft Test Manager. To run the latest version of your automated test, you must make sure that the correct build is selected for your test plan. You must also use a physical or virtual environment to run your automated tests. This is out of scope of this guidance however we recommend this the most. </p>            <p><i></i></p>            <p><i>Refer to: </i><a href="http://msdn.microsoft.com/en-us/library/dd553270.aspx"><i>http://msdn.microsoft.com/en-us/library/dd553270.aspx</i></a><i></i> </p>            <p><i></i></p>         </td>       </tr>     </tbody></table> </p>  <h3><a name="_Toc311287836"></a><a name="_Web_Service_Performance"></a>Web Service Performance Testing using Unit Test/Web Test + Load Test</h3>  <p>Now when you have your Web Services Test automated either using Unit Test or Web Test as suggested in this guidance above, you can go ahead and create you Load Test to performance test your web services.    <table border="1" cellspacing="0" cellpadding="0" width="795"><tbody>       <tr>         <td valign="top" width="38">           <p>SL No.</p>         </td>          <td valign="top" width="128">           <p>Areas</p>         </td>          <td valign="top" width="627">           <p>Description</p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>1.</p>         </td>          <td valign="top" width="128">           <p>Configuration – Load Testing </p>            <p><i></i></p>         </td>          <td valign="top" width="627">           <p>a) Ensure you have selected our custom solution configuration for Load Test i.e. Debug – Load Test </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2768.clip_image001_35E35108.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2768.clip_5F00_image001_5F00_35E35108.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7080.clip_image001_thumb_2908FAEA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7080.clip_5F00_image001_5F00_thumb_5F00_2908FAEA.png" width="397" height="261" /></a> </p>            <p>b) As shown below it uses a compilation symbol <b>#WEBSERVICES_LOAD_TESTING</b> that is used in our test methods to control the behavior. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5342.image_0B374A5E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5342.image_5F00_0B374A5E.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8463.image_thumb_3D4E74DB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8463.image_5F00_thumb_5F00_3D4E74DB.png" width="436" height="168" /></a> </p>            <p>c) Inside your test methods, you will have code like this to control the behavior based on the solution configuration file that is selected</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2210.image_1F40411A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2210.image_5F00_1F40411A.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8081.image_thumb_48D40C4D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8081.image_5F00_thumb_5F00_48D40C4D.png" width="455" height="121" /></a></p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>2.</p>         </td>          <td valign="top" width="128">           <p><i></i></p>            <p><i>Creating <b>Load Test</b> using Web Services <b>Unit Test or Web Test</b> </i></p>            <p><i>(Designed in above sections)</i></p>         </td>          <td valign="top" width="627">           <p>&#160; </p>            <p>Step 1. Add a new Load Test </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8475.image_0D33FD8D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8475.image_5F00_0D33FD8D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7827.image_thumb_0F40D689.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7827.image_5F00_thumb_5F00_0F40D689.png" width="396" height="345" /></a> </p>            <p>Step 2. Give a scenario name for your Load test </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5342.image_42D91D1A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5342.image_5F00_42D91D1A.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6835.image_thumb_75C8AD81.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6835.image_5F00_thumb_5F00_75C8AD81.png" width="405" height="261" /></a> </p>            <p>Step 3. Specify your load pattern (Constant Load/ Step Load) </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4278.image_72D348CE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4278.image_5F00_72D348CE.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6431.image_thumb_10D156C3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6431.image_5F00_thumb_5F00_10D156C3.png" width="418" height="274" /></a> </p>            <p>Step 4. Choose an appropriate test mix </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8407.image_46869C1D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8407.image_5F00_46869C1D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4300.image_thumb_2E338202.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4300.image_5F00_thumb_5F00_2E338202.png" width="457" height="295" /></a> </p>            <p>Step 5.<b> </b><i>This is the most important step where you have an option to select Unit Test or Web Test to be added to your Load test depending on the kind of approach you had selected for your Web services automation above</i> </p>            <p>Press Add and select your <b>“Web Services Unit Test” OR “Web Services Web Tests” </b>created in the sections above<b> </b>that you want to performance test </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0576.image_27DC85A7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0576.image_5F00_27DC85A7.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6740.image_thumb_2070A02D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6740.image_5F00_thumb_5F00_2070A02D.png" width="460" height="327" /></a> </p>            <p>Press OK and adjust Distribution of tests. </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4705.image_0BDB2AE2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4705.image_5F00_0BDB2AE2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2158.image_thumb_37AB7ED1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2158.image_5F00_thumb_5F00_37AB7ED1.png" width="473" height="307" /></a> </p>            <p>Step 6. Refer to below section for adding custom web services counters other than standard counters that you may want to monitor </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5367.image_5AABCA74.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5367.image_5F00_5AABCA74.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0488.image_thumb_6926C699.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0488.image_5F00_thumb_5F00_6926C699.png" width="485" height="315" /></a> </p>            <p>Step 7. Specify Load run settings </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4377.image_4B1892D8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4377.image_5F00_4B1892D8.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1651.image_thumb_41DC5797.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1651.image_5F00_thumb_5F00_41DC5797.png" width="503" height="334" /></a> </p>            <p>Step 8. You load test is created </p>            <p>Our sample Unit Test and WebTest template project has this reusable <b>SampleLoadTest.loadtest </b>sample load test for you to model your load tests around.</p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6036.image_75086B33.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6036.image_5F00_75086B33.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2543.image_thumb_1808B6D7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2543.image_5F00_thumb_5F00_1808B6D7.png" width="342" height="421" /></a></p>         </td>       </tr>        <tr>         <td valign="top" width="38">           <p>3.</p>         </td>          <td valign="top" width="128">           <p>Running Load Test and analyzing results</p>         </td>          <td valign="top" width="627">           <p><i></i></p>            <p><i></i>&#160; </p>            <p><i>For Web services Load testing, we recommend you adding following custom counters against the web services server (where the web services are hosted):</i> </p>            <p><i></i></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5488.clip_image00114_400B4029.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5488.clip_5F00_image00114_5F00_400B4029.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[14]" border="0" alt="clip_image001[14]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7026.clip_image00114_thumb_3F32DA3F.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7026.clip_5F00_image00114_5F00_thumb_5F00_3F32DA3F.gif" width="15" height="15" /></a> ServiceModelEndPoint 3 </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4214.clip_image00115_2968F1E2.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4214.clip_5F00_image00115_5F00_2968F1E2.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[15]" border="0" alt="clip_image001[15]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1256.clip_image00115_thumb_1D6701AE.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1256.clip_5F00_image00115_5F00_thumb_5F00_1D6701AE.gif" width="15" height="15" /></a> ServiceModelEndPoint 4 </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2146.clip_image00116_6EA1490B.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2146.clip_5F00_image00116_5F00_6EA1490B.gif"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[16]" border="0" alt="clip_image001[16]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0181.clip_image00116_thumb_6DC8E321.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0181.clip_5F00_image00116_5F00_thumb_5F00_6DC8E321.gif" width="15" height="15" /></a> ServiceModelOperation </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0160.clip_image00117_06588072.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0160.clip_5F00_image00117_5F00_06588072.gif"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[17]" border="0" alt="clip_image001[17]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5466.clip_image00117_thumb_336D6D40.gif" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5466.clip_5F00_image00117_5F00_thumb_5F00_336D6D40.gif" width="15" height="15" /></a> ServiceModelServices </p>            <p><i></i></p>            <p><i></i></p>            <p><i>Please follow </i><a href="http://msdn.microsoft.com/en-us/library/ms404668(v=VS.100).aspx"><i>Adding custom counters set using Load Test Editor</i></a><i> for detailed steps.</i> </p>            <p><i></i></p>            <p><i>Step 1. Open you load test. Right click you counter set and add “</i>Custom Counter Sets” </p>            <p><i></i></p>            <p><i>Step 2. Right click and now click “Add Counters”</i> </p>            <p><i></i></p>            <p><i>Select Performance Category to include counters related to Web Services as shown below </i></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6355.image_79EA5D48.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6355.image_5F00_79EA5D48.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4300.image_thumb_1D56DBE1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4300.image_5F00_thumb_5F00_1D56DBE1.png" width="488" height="345" /></a> </p>            <p><i></i></p>            <p><i></i></p>            <p><i>Step 3. Repeat it for all the categories as shown below.</i> </p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2234.image_6C63FEA8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2234.image_5F00_6C63FEA8.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1072.image_thumb_5913223C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1072.image_5F00_thumb_5F00_5913223C.png" width="456" height="471" /></a> </p>            <p><i></i></p>            <p><i></i></p>            <p><i></i></p>            <p><b>Tip</b>: You can enable performance counters for a WCF service through the app.config configuration file of the WCF service as follows:<i></i> </p>            <p><i></i></p>            <p><i>&lt;configuration&gt;</i> </p>            <p><i>&lt;system.serviceModel&gt;</i> </p>            <p><i>&lt;diagnostics performanceCounters=&quot;All&quot; /&gt;</i> </p>            <p><i>&lt;/system.serviceModel&gt;</i> </p>            <p><i>&lt;/configuration&gt;</i> </p>            <p><i></i></p>            <p><b><i>Sample Load Test Summary Report</i></b> </p>            <p><i></i></p>            <p><i></i></p>            <p><i></i></p>            <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6763.image_5A376F81.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6763.image_5F00_5A376F81.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6740.image_thumb_698AD190.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6740.image_5F00_thumb_5F00_698AD190.png" width="505" height="330" /></a></p>         </td>       </tr>     </tbody></table> </p>  <h3><a name="_Toc284684681"></a><a name="_Toc284684673"></a><a name="_Web_Services_Test"></a></h3>  <h3>&#160;</h3>  <h3>&#160;</h3>  <h3><a name="_Toc311287837">Web Services Helper Documentation for Unit Test &amp; Web Test Add-ins</a></h3>  <p>This section provides documentation of the complete list of reusable helper functions (<b>WebServicesTesting.Automation.WebTest.Helper.dll</b>) and web add-ins (<b>WebServicesTesting</b>.<b>Automation.UnitTest.Helper.dll</b>) for your reference and usage. We have shown few of these in sample walkthrough above to give you a glimpse of the same.</p>  <p>&#160;</p>  <p>   <table border="1" cellspacing="0" cellpadding="0" width="806"><tbody>       <tr>         <td valign="top" width="109">           <p><b>Category</b></p>         </td>          <td valign="top" width="116">           <p><b>Title</b></p>         </td>          <td valign="top" width="140">           <p><b>Description</b></p>         </td>          <td valign="top" width="199">           <p><b>Unit Method Signature &amp; Example invoke call </b></p>         </td>          <td valign="top" width="240">           <p><b>Web Custom Extension (Extraction &amp; Validation Rules)</b></p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Lookup Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies the Scalar value or multiple scalar values of even different data types returned by services against expected results </p>         </td>          <td valign="top" width="140">           <p>This method will let you compare the scalar values of different types like &lt;INT&gt;, &lt;STRING&gt; etc. returned by the service method call converting them to &lt;string&gt;against the expected values </p>         </td>          <td valign="top" width="199">           <p>public void CompareStringArray(int condition, string query, string[] ArrgetAgeActual) </p>            <p>Example: </p>            <p>obj.CompareStringArray(2, query, ArrgetAgeActual);</p>         </td>          <td valign="top" width="240">           <p>For scalar value </p>            <p><b><u>Extraction Rule</u></b> </p>            <p>ServiceResponseExtraction </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.XpathExpression </p>            <p>2.ContextParam </p>            <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>ServiceResponseValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.Expected </p>            <p>2.ContextParam </p>            <p>For multiple values </p>            <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>DataSetValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.ConnString </p>            <p>2.Query </p>            <p>3.XPathExpression </p>            <p>4.ContextParam </p>            <p>The validation rule extracts the dictionary returned by web service from xml and compares with the expected dataset based on the query</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Lookup Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies the values of <i>&lt;DICTIONARY&gt;</i> data type returned by services against the expected results</p>         </td>          <td valign="top" width="140">           <p>This method will let you compare the &lt;Dictionary&gt; &lt;key, value&gt; values returned by service method call against the expected values &lt;key, value&gt;.</p>         </td>          <td valign="top" width="199">           <p>public void CompareDictionaryWithExpectedArray(Dictionary&lt;int, string&gt; ActualDic, string[,] ArrgetAgeExpected) </p>            <p>Example : </p>            <p>obj.CompareDictionaryWithExpectedArray(col_Symbols, ArrgetAgeExpected);</p>         </td>          <td valign="top" width="240">           <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>DataSetValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.ConnString </p>            <p>2.Query </p>            <p>3.XPathExpression </p>            <p>4.ContextParam </p>            <p>The validation rule extracts the dictionary returned by webservice from xml and compares with the expected dataset based on the query</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Lookup Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies the values of <i>&lt;LIST&gt;</i> data type returned by services against the expected results</p>         </td>          <td valign="top" width="140">           <p>This method will let you compare the values of data type &lt;LIST&gt; returned by service method call against the expected values</p>         </td>          <td valign="top" width="199">           <p>public string[] CompareList(string query) </p>            <p>Example: </p>            <p>string[] ArrgetAgeExpected = obj.CompareList(query);</p>         </td>          <td valign="top" width="240">           <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>DataSetValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.ConnString </p>            <p>2.Query </p>            <p>3.XPathExpression </p>            <p>4.ContextParam </p>            <p>The validation rule extracts the List returned by webservice from xml and compares with the expected dataset based on the query</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Lookup Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies the result set returned by services against expected results </p>         </td>          <td valign="top" width="140">           <p>This method will let you compare the result set returned by service method call against the expected result set</p>         </td>          <td valign="top" width="199">           <p><b><u>Method Prototype</u></b> </p>            <p>public void Verify_Dataset(string ConnString, string Query, DataSet dst) </p>            <p><b><u>Method Invocation</u></b> </p>            <p>UnitTest help = new UnitTest(); </p>            <p>help.Verify_Dataset(conn, query, set); </p>            <p><b><u></u></b></p>            <p><b><u></u></b></p>            <p><b><u></u></b></p>         </td>          <td valign="top" width="240">           <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>DataSetValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.ConnString </p>            <p>2.Query </p>            <p>3.XPathExpression </p>            <p>4.ContextParam </p>            <p>The validation rule extracts the dataset returned by webservice from xml and compares with the expected dataset based on the query</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Lookup Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies the row count of the values returned by Web Services against expected result</p>         </td>          <td valign="top" width="140">           <p>This method will let you validate the row count of the values/list/dataset returned by service method call against the expected row count</p>         </td>          <td valign="top" width="199">           <p><b><u>Method Prototype</u></b> </p>            <p>public void Verify_RowCountDataSet(int expected, int actual) </p>            <p><b><u>Method Invocation</u></b> </p>            <p>UnitTest help = new UnitTest(); </p>            <p>help.Verify_RowCountDataSet(expected, actual);</p>         </td>          <td valign="top" width="240">           <p><b><u>Extraction Rule</u></b> </p>            <p><b><u></u></b></p>            <p>RowCountExtraction </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.XpathExpression </p>            <p>2.ContextParam </p>            <p>This method extracts the row count and stores the value to Context Param specified by the user. </p>            <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>RowValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.ConnString </p>            <p>2.Query </p>            <p>3.ContextParam </p>            <p>4.ContextParam </p>            <p>This method validates the value set to the context param and the one returned by the specified query</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Metadata Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies the called web service method has schema as expected</p>         </td>          <td valign="top" width="140">           <p>This method validates the XML file to make sure it fits to your application's needs to prevent any exception in your code. To check whether the XML document conforms to an XSD Schema, the document must be validated against that XSD Schema</p>         </td>          <td valign="top" width="199">           <p><b><u>Method Prototype</u></b> </p>            <p>public bool Verify_Schema(string targetNameSpace, string xsdPath,string requestXml) </p>            <p><b><u>Event Handler to raise error</u></b> </p>            <p>private static void ValidationEventHandler(object sender, System.Xml.Schema.ValidationEventArgs arg) </p>            <p><b><u>Method Invocation</u></b> </p>            <p>UnitTest help = new UnitTest(); </p>            <p>bool validation = help.Verify_Schema(targetNameSpace ,XsdPath,requestXml);</p>         </td>          <td valign="top" width="240">           <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>SchemaValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.targetNameSpace </p>            <p>2. xsdPath</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Metadata Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies that web service methods exist and their parameters definition (like input parameters, return type) against expected result</p>         </td>          <td valign="top" width="140">           <p>This method will let you smoke test / BVT if the expected list of Web Service methods exists and their definition like input parameters and return type matches.</p>         </td>          <td valign="top" width="199">           <p><b><u>Method Prototype</u></b> </p>            <p>public void Verify_methodPrototype(object myObject, string Methodname, string paramlist, string returnTypelist) </p>            <p><b><u>Method Invocation</u></b> </p>            <p>UnitTest help = new UnitTest(); </p>            <p>help.Verify_methodPrototype(obj, methodlist, paramlist, returnTypelist);</p>         </td>          <td valign="top" width="240">           <p><b><u>Extraction Rule</u></b> </p>            <p>ParameterExtraction </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.XpathExpression </p>            <p>2.ContextParam </p>            <p>This method extracts the parameter passed to the request and set to the contextparam </p>            <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>ParamValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.ParamValues </p>            <p>2.ContextParam </p>            <p>This method validates the value set to the context param and the Values passed to the ParamValues </p>            <p>The above extraction &amp; validation rule is used to validate the parameter passed </p>            <p>The below extraction &amp; validation rule is used to validate value returned by the webservice </p>            <p><b><u>Extraction Rule</u></b> </p>            <p>ServiceResponseExtraction </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.XpathExpression </p>            <p>2.ContextParam </p>            <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>ServiceResponseValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.Expected </p>            <p>2.ContextParam</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Transactional Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies that called web service method creates the output file as expected</p>         </td>          <td valign="top" width="140">           <p>This method verifies the output file (e.g. CSV, XML, TXT) has got created by the web service method call</p>         </td>          <td valign="top" width="199">           <p><b><u>Method Prototype</u></b> </p>            <p>public void Verify_FileCreation(string FilePath) </p>            <p><b><u>Method Invocation</u></b> </p>            <p>UnitTest help = new UnitTest(); </p>            <p>help.Verify_FileCreation(&quot;D:\\employees.xml&quot;);</p>         </td>          <td valign="top" width="240">           <p><b><u>Validation Rule</u></b> </p>            <p>FileCreationValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.FilePath</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Transactional Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies that web service <i>INSERTS/CREATES</i> a new record into the database</p>         </td>          <td valign="top" width="140">           <p>This method verifies the web service call results into new record insertion in a given database</p>         </td>          <td valign="top" width="199">           <p><b><u>Method Prototype</u></b> </p>            <p>public void Verify_DbInsert(string ConnString, string Query, string expected) </p>            <p><b><u>Method Invocation</u></b> </p>            <p>UnitTest help = new UnitTest(); </p>            <p>help.Verify_DbInsert(conn, query, expected);</p>         </td>          <td valign="top" width="240">           <p><b><u>Extraction Rule</u></b> </p>            <p>ParameterExtraction </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.XpathExpression </p>            <p>2.ContextParam </p>            <p>This method extracts the parameter passed to the request and set to the contextparam </p>            <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>DbInsertValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.ConnString </p>            <p>2.ContextParam </p>            <p>3.Query </p>            <p>4.ContextParam </p>            <p>This method validates the contextparam and the values returned by the query</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Transactional Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies that web service <i>UPDATES existing</i> records into the database</p>         </td>          <td valign="top" width="140">           <p>This method verifies the web service call results into update of existing record(s) in the given database</p>         </td>          <td valign="top" width="199">           <p><b><u>Method Prototype</u></b> </p>            <p>public void Verify_DBUpdate(string ConnString, string Query, string expected) </p>            <p><b><u>Method Invocation</u></b> </p>            <p>UnitTest help = new UnitTest(); </p>            <p>help.Verify_DBUpdate(conn, query, expected);</p>         </td>          <td valign="top" width="240">           <p><b><u>Extraction Rule</u></b> </p>            <p>ParameterExtraction </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.XpathExpression </p>            <p>2.ContextParam </p>            <p>This method extracts the parameter passed to the request and set to the contextparam </p>            <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>UpdateDbValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.ConnString </p>            <p>2.ContextParam </p>            <p>3.Query </p>            <p>4.ContextParam </p>            <p>This method validates the contextparam and the values returned by the query</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Transactional Verification</p>         </td>          <td valign="top" width="116">           <p>Verifies that web service DELETES records into a database</p>         </td>          <td valign="top" width="140">           <p>This method verifies the web service call results into deletion of existing record(s) from a given database</p>         </td>          <td valign="top" width="199">           <p><b><u>Method Prototype</u></b> </p>            <p>public void Verify_DBDelete(string ConnString, string Query) </p>            <p><b><u>Method Invocation</u></b> </p>            <p>UnitTest help = new UnitTest(); </p>            <p>help.Verify_DBDelete(conn, query);</p>         </td>          <td valign="top" width="240">           <p><b><u>Validation Rule</u></b> </p>            <p>DeleteDbValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.ConnString </p>            <p>2.Query </p>            <p>This method verifies the rows returned by query is 0</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Workflow service</p>         </td>          <td valign="top" width="116">           <p>Verify that web service executed the workflow and end result is as expection</p>         </td>          <td valign="top" width="140">           <p>_________For this one we just need a test method in our test file instead of a separate helper method____</p>         </td>          <td valign="top" width="199">           <p>Sample code to verify the result returned by the workflow </p>            <p>IDictionary&lt;string, object&gt; _d = new Dictionary&lt;string, object&gt;() { { &quot;userArgument&quot;, arg } }; </p>            <p>_d = WorkflowInvoker.Invoke(new Workflow1(), _d); </p>            <p>Int32 outPut = (Int32)_d[&quot;OutputValue&quot;]; </p>            <p>Assert.AreEqual(expected, outPut); </p>            <p>output can be validated with expected for its correctness</p>         </td>          <td valign="top" width="240">           <p>WorkFlow cannot be invoked. </p>            <p>We can invoke the web service to verify the result returned by service method against the expected result. </p>            <p><b><u>Extraction Rule</u></b> </p>            <p>ServiceResponseExtraction </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.XpathExpression </p>            <p>2.ContextParam </p>            <p><b><u>Validation Rule</u></b> </p>            <p><b><u></u></b></p>            <p>ServiceResponseValidation </p>            <p><b><u>Context Parameters</u></b> </p>            <p><b><u></u></b></p>            <p>1.Expected </p>            <p>2.ContextParam</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Authentication</p>         </td>          <td valign="top" width="116">           <p>Verifies that user credentials &amp; certificate are validated against the server to authenticate the user trying to access the web service</p>         </td>          <td valign="top" width="140">           <p>This method verifies the user credentials and certificate to ensure that he is authenticated to get the results from the web service</p>         </td>          <td valign="top" width="199">           <p>var ServiceendPoint = new EndpointAddress(new Uri(&quot;http://localhost:91/Service1.svc&quot;), EndpointIdentity.CreateDnsIdentity(&quot;MyWebSite&quot;)); </p>            <p>var binding = new WSHttpBinding(); </p>            <p>binding.Security.Mode = SecurityMode.Message; </p>            <p>binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName; </p>            <p>var result = new Auth_Service.Service1Client(binding, ServiceendPoint); </p>            <p>try </p>            <p>{ </p>            <p>result.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None; </p>            <p>result.ClientCredentials.UserName.UserName = auth_username; </p>            <p>result.ClientCredentials.UserName.Password = auth_passwd; </p>            <p>time = result.GetServertime(); </p>            <p>}</p>         </td>          <td valign="top" width="240">&#160;</td>       </tr>        <tr>         <td valign="top" width="109">           <p>Encryption</p>         </td>          <td valign="top" width="116">           <p>Verifies that web service is encrypting the message/transport layer when returning data</p>         </td>          <td valign="top" width="140">           <p>This method will verify that web service is encrypting and decrypting the data as required by business.</p>         </td>          <td valign="top" width="199">           <p>Configuration appConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); </p>            <p>ServiceModelSectionGroup serviceModel = ServiceModelSectionGroup.GetSectionGroup(appConfig); </p>            <p>Console.WriteLine(&quot;Configuration Name : Address : Binding : Contract&quot;); </p>            <p>foreach (ChannelEndpointElement endpoint in serviceModel.Client.Endpoints) </p>            <p>{ </p>            <p>if (endpoint.Contract == &quot;Auth_Service.IService1&quot;) </p>            <p>{ </p>            <p>binding_used = endpoint.Binding; </p>            <p>break; </p>            <p>} </p>            <p>else </p>            <p>{ </p>            <p>} </p>            <p>} </p>            <p>Auth_Service.Service1Client result = new Auth_Service.Service1Client(); </p>            <p>result.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None; </p>            <p>result.ClientCredentials.UserName.UserName = auth_username; </p>            <p>result.ClientCredentials.UserName.Password = auth_passwd; </p>            <p>string time = result.GetServertime(); </p>            <p>TestContext.WriteLine(&quot;Bindings used by this contract is &quot; + binding_used);</p>         </td>          <td valign="top" width="240">&#160;</td>       </tr>        <tr>         <td valign="top" width="109">           <p>Caching</p>         </td>          <td valign="top" width="116">           <p>Verifies that data returned by called web service is returned from cache</p>         </td>          <td valign="top" width="140">           <p>_________For this one we just need a test method in our test file instead of a separate helper method____              <br />Caching is frequently used as an optimization in distributed systems. It can be used to avoid re-doing computations or complex database access when the results remain valid for an extended period of time. In this case, subsequent requests for the same information can be served with the cached version rather than repeat the processing with the associated overheads. </p>         </td>          <td valign="top" width="199">           <p>string url = &quot;http://localhost/Cache/Service1.svc/xml/12&quot;; </p>            <p>Uri uri = new Uri(url); </p>            <p>WebRequest request = (HttpWebRequest)WebRequest.Create(uri); </p>            <p>request.Method = &quot;GET&quot;; </p>            <p>HttpWebResponse response = (HttpWebResponse)request.GetResponse(); </p>            <p>Stream receiveStream = response.GetResponseStream(); </p>            <p>StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8); </p>            <p>string firstResponse = readStream.ReadLine(); </p>            <p>Above code snippet shows to retrieve server response. </p>            <p>To test caching two request should be made befor cache expires and should be validated.</p>         </td>          <td valign="top" width="240">           <p><b><u>Extraction Rule</u></b> </p>            <p>CacheExtraction </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.XpathExpression </p>            <p>2.ContextParam </p>            <p>3.Delay </p>            <p>To test caching two request should be made before caching expire and one after caching expire. </p>            <p>Parameter Delay has to be passed for the second request </p>            <p>And plugin <b>DelayPlugin </b>should be associated with the second service </p>            <p>CacheOutcomePlugin </p>            <p><b><u>ContextParameters</u></b> </p>            <p>1.ContextParam1 </p>            <p>2.ContextParam2 </p>            <p>3.ContextParam3</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Caching</p>         </td>          <td valign="top" width="116">           <p>Verifies that data returned by called web service is returned from database when cache is expired</p>         </td>          <td valign="top" width="140">           <p>_________For this one we just need a test method in our test file instead of a separate helper method____</p>         </td>          <td valign="top" width="199">           <p>string url = &quot;http://localhost/Cache/Service1.svc/xml/12&quot;; </p>            <p>Uri uri = new Uri(url); </p>            <p>WebRequest request = (HttpWebRequest)WebRequest.Create(uri); </p>            <p>request.Method = &quot;GET&quot;; </p>            <p>HttpWebResponse response = (HttpWebResponse)request.GetResponse(); </p>            <p>Stream receiveStream = response.GetResponseStream(); </p>            <p>StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8); </p>            <p>string firstResponse = readStream.ReadLine(); </p>            <p>Above code snippet shows to retrieve server response. </p>            <p>To test caching two request should be made before caching expire and one after caching expire and should be validated.</p>         </td>          <td valign="top" width="240">&#160;</td>       </tr>        <tr>         <td valign="top" width="109">           <p>Non-XML Data</p>         </td>          <td valign="top" width="116">           <p>Verifies that called web service method sends/returns non-xml data (like blob, image) as expected</p>         </td>          <td valign="top" width="140">           <p>This method will verify that web service method is storing or retrieving the non XML data like blob from file system or database</p>         </td>          <td valign="top" width="199">           <p>Refer our reusable </p>            <p>[TestMethod] </p>            <p>public void VerifyNonXMLData()</p>         </td>          <td valign="top" width="240">&#160;</td>       </tr>        <tr>         <td valign="top" width="109">           <p>Asynchronous messaging</p>         </td>          <td valign="top" width="116">           <p>Verifies that called web service method if implemented as asynchronous then returns the data as expected at a later point in time</p>         </td>          <td valign="top" width="140">           <p>This method verifies the asynchronous behavior of web service method as expected and implemented.</p>         </td>          <td valign="top" width="199">           <p>Refer our reusable </p>            <p>[TestMethod] </p>            <p>public void VerifyAsync_Response()</p>         </td>          <td valign="top" width="240">&#160;</td>       </tr>        <tr>         <td valign="top" width="109">           <p>Exception and Error handling</p>         </td>          <td valign="top" width="116">           <p>Verify that service returns appropriate error message when there is a fault exception like underlying database connectivity issue to ensure exception and error handling</p>         </td>          <td valign="top" width="140">           <p>This method will verify that web service method that is called handles the exceptions like timeout, connectivity/networking issue as expected</p>         </td>          <td valign="top" width="199">           <p>&lt;serviceDebug includeExceptionDetailInFaults=&quot;True&quot; /&gt; </p>            <p>Set the IncludeExceptionDetailInFaults property to true to instruct to return managed exception information to the client in SOAP faults to ease debugging </p>            <p>try </p>            <p>{ </p>            <p>WCFServiceRef.Service1Client obj = new WCFServiceRef.Service1Client(); </p>            <p>obj.Display(); </p>            <p>} </p>            <p>catch (FaultException e) </p>            <p>{ </p>            <p>string str = e.Message.ToString(); </p>            <p>TestContext.WriteLine(str); </p>            <p>}</p>         </td>          <td valign="top" width="240">           <p><b><u>Extraction Rule</u></b> </p>            <p>ExceptionExtraction </p>            <p><b><u>ContextParameter</u></b> </p>            <p>1.contextParam </p>            <p><b><u>Validation Rule</u></b> </p>            <p>ExceptionValidation </p>            <p><b><u>ContextParameter</u></b> </p>            <p>1.contextParam </p>            <p>2.ErrorMsg </p>            <p><b><u></u></b></p>            <p><b><u>ExceptionPlugin</u></b> </p>            <p><b><u>ContextParameter</u></b> </p>            <p>1.contextParam </p>            <p><b><u></u></b></p>            <p>Plugin is used to pass/fail the test case </p>            <p>contextParam name provided in extraction/validation/plugin should be same</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>Merge</p>         </td>          <td valign="top" width="116">           <p>Verifies the result obtained from multiple web services calls by merging them matches against consolidated expected output</p>         </td>          <td valign="top" width="140">           <p>This method verifies when similar result is obtained from multiple web services and then need to be validated against single expected result set              <br />Think of a scenario where you are getting similar result from various source - each a different web service call. The tester wants to validate the consolidated output from these services by comparing it against expected values</p>         </td>          <td valign="top" width="199">           <p>WCFServiceRef.Service1Client obj = new WCFServiceRef.Service1Client(); </p>            <p>string expected = &quot;5 Test&quot;; </p>            <p>string exmaple1 = obj.mergeExample().ToString(); </p>            <p>string example2 = obj.mergeExample1(); </p>            <p>string actual = exmaple1 + &quot; &quot;+ example2; </p>            <p>Assert.AreEqual(expected, actual);</p>         </td>          <td valign="top" width="240">           <p><b><u>Extraction Rule</u></b> </p>            <p>ServiceResponseExtraction </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1.XpathExpression </p>            <p>2.ContextParam </p>            <p>The extraction rule is used with both the request to extract the response from the server </p>            <p>Associate the validation rule with the 2<sup>nd</sup> request </p>            <p><b><u>Validation Rule</u></b> </p>            <p>MergeTwoServcResponseValidation </p>            <p><b><u>ContextParameter</u></b> </p>            <p><b><u>Context Parameters</u></b> </p>            <p>1. ContextParam1 </p>            <p>2.ContextParam2 </p>            <p>3.expected</p>         </td>       </tr>        <tr>         <td valign="top" width="109">           <p>DTO based Validations</p>         </td>          <td valign="top" width="116">           <p>DTO (Data Transfer Objects) based validation is a generic way to validate web services response of any data type against expected result by converting them into generics objects</p>         </td>          <td valign="top" width="140">           <p>It works by converting the service response (whether abstract or primitive data types) and expected results into standard generic objects which then are finally converted into XML for comparison with the help of our reusable library methods as described below in the example</p>         </td>          <td valign="top" width="199">           <p>public List&lt;T&gt; DTO_PopulateObject&lt;T&gt;(object DTOObject, object myObj) </p>            <p>public List&lt;T&gt; DTO_PopulateDBResults&lt;T&gt;(DataTable dt) where T : class </p>            <p>public bool DTO_XmlComparison(Object ExpectedDTOList, Object ActualDTOList, Type ObjectType) </p>            <p>Examples: </p>            <p>ExpectedStudentDTOList = helper.DTO_PopulateDBResults&lt;Student&gt;(dt); </p>            <p>object ActualStudentDTOList = helper.DTO_PopulateObject&lt;Student&gt;(myObj, s1); </p>            <p>bool result = helper.DTO_XmlComparison(ExpectedStudentDTOList, ActualStudentDTOList, typeof(List&lt;Student&gt;));</p>         </td>          <td valign="top" width="240">           <p><b><u></u></b></p>         </td>       </tr>     </tbody></table> </p>  <h3><a name="_Toc311287838">Tools to speed up Web Services Testing</a></h3>  <p>&#160;</p>  <h4><a name="_Toc311287839"><font size="4" face="Arial">WCF Load Test</font></a></h4>  <p>This tool helps us in accelerating the generation of Skeleton unit test which can be used for load test of Application. </p>  <p>This tool takes the WCF or Fiddler2 message log file and a WCF client proxy, or a WCF interface contract, and generates a unit test that replays the same sequence of calls found in the message log file for WCF and ASMX services. The code generated is easily modifiable so that data variation can be introduced for the purpose of doing performance testing. </p>  <p>The tool will also integrate with Visual Studio 2005/2008 Team Edition for Software Testers and Visual Studio 2010 Ultimate and installs a wizard for creating the message log and processing it from within Visual Studio. </p>  <p>Tool can be downloaded from </p>  <p><a href="http://wcfloadtest.codeplex.com/releases/view/51762">http://wcfloadtest.codeplex.com/releases/view/51762</a> </p>  <p>This tool is an add-in to VS and after running the .msi, open Visual studio and from the test menu, create a new test .It contains a template for the WCF Test. </p>  <p>1. Create a new Test Project and select the WCF test from the templates available for the test. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6763.image_17D43171.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6763.image_5F00_17D43171.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7532.image_thumb_3AA4CD54.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7532.image_5F00_thumb_5F00_3AA4CD54.png" width="456" height="477" /></a> </p>  <p>2. Click on Next </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1256.image_053B6F55.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1256.image_5F00_053B6F55.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8424.image_thumb_0AE6632E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8424.image_5F00_thumb_5F00_0AE6632E.png" width="544" height="376" /></a> </p>  <p>3. Give the path of the executable, it’s your application exe files, in this case it’s the sample App application which we are using for the generation of unit test. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0005.image_4AA023E6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0005.image_5F00_4AA023E6.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2642.image_thumb_51AF3A91.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2642.image_5F00_thumb_5F00_51AF3A91.png" width="560" height="365" /></a> </p>  <p>4. Click on Run, will run the application and load the data as expected. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7851.image_01E5E97B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7851.image_5F00_01E5E97B.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6283.image_thumb_02AE2998.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6283.image_5F00_thumb_5F00_02AE2998.png" width="571" height="309" /></a> </p>  <p>5. Test the application; change the values in the List of Students to fire the service with different set of Data. Once this is done, close the application. </p>  <p>And click on Next on the ‘New WCF Service Test Generator wizard’ </p>  <p>6. There will be screen which depicts what all methods were invoked when we navigated the application with different set of inputs. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4214.image_635B5CF7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4214.image_5F00_635B5CF7.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5633.image_thumb_7C47076F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5633.image_5F00_thumb_5F00_7C47076F.png" width="584" height="393" /></a> </p>  <p>7. Click Next, Now we need to add the Dll/exe which define the contracts which are implemented for the WCF service which we have consumed. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8053.image_1B0D5581.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8053.image_5F00_1B0D5581.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2677.image_thumb_3947E6AA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2677.image_5F00_thumb_5F00_3947E6AA.png" width="597" height="380" /></a> </p>  <p>8. Click on finish and the Unit tests are created for actions which we have performed on the Application. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3568.image_75638C85.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3568.image_5F00_75638C85.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5314.image_thumb_32380E58.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5314.image_5F00_thumb_5F00_32380E58.png" width="594" height="311" /></a> </p>  <p>&#160; </p>  <h4><a name="_Toc311287840"><font size="4" face="Arial">Web Test Plug In for Silverlight + RIA based services</font></a></h4>  <p>When testing Silver Light applications, we frequently run into dealing with non-Html content types. This is because most of the Silver Light applications use WCF RIA web services. Typically, this will be a binary format called MSBin1. Also, Silver Light applications may use other content types such as JSON, SOAP and REST to communicate with server. In general there is significantly greater use of Web Services and JSON in today's web applications. </p>  <p>The <a href="http://teamtestplugins.codeplex.com/releases/view/43166">Web Test Plugins for Web Service Messages</a> leverage these extensibility points to provide the following functionality for all these content types: </p>  <p>1. Select the Web Service plugin to enable Web Service message plugins before recorder shows up when we create a new web test project. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5635.image_528F9E4A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5635.image_5F00_528F9E4A.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6403.image_thumb_0E1F873E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6403.image_5F00_thumb_5F00_0E1F873E.png" width="592" height="212" /></a> </p>  <p>2. After Recording is completed it adds a reference to the runtime assembly to project, and adds the web service plugin to the Web Test </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1106.image_2FDB3A02.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1106.image_5F00_2FDB3A02.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1512.image_thumb_5CF026D0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1512.image_5F00_thumb_5F00_5CF026D0.png" width="364" height="228" /></a> </p>  <p>3. In recording result we can see a new tab named as “Web Service” </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2021.image_00C8D85E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2021.image_5F00_00C8D85E.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7888.image_thumb_435873D6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7888.image_5F00_thumb_5F00_435873D6.png" width="522" height="110" /></a> </p>  <p>4. Right click on the selected node, and select “Add Extraction Rule” or “Add Validation Rule” from the context menu. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8877.image_77206A27.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8877.image_5F00_77206A27.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5722.image_thumb_7648043D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5722.image_5F00_thumb_5F00_7648043D.png" width="532" height="202" /></a> </p>  <p>Reference- &lt;<a href="http://blogs.msdn.com/b/mahipalkante/archive/2010/04/07/web-test-plugins-for-web-service-messages.aspx">http://blogs.msdn.com/b/mahipalkante/archive/2010/04/07/web-test-plugins-for-web-service-messages.aspx</a>&gt; </p>  <p>&#160; </p>  <h3><a name="_Toc311287841">Web Services Automation Benefits</a></h3>  <p>· Increase the quality of the application and find issues/bugs quicker and easily by validating web services for functionality without relying or testing the UI layer too much which is many times slower. </p>  <p><b></b></p>  <p>· Many times when UI is under development or for V1.0 projects where UI is changing a lot often, UI automation doesn’t give you’re the ROI in short term and Web Services automation can help you quickly validate the functionality and business layer. </p>  <p>· The effort and investment on automating Web Services for functionality will also pay off later to quickly build you performance test suite with lesser effort and reuse. </p>  <p>· This will also help to scale up when doing performance testing to ensure that web services behave as per SLA and as-expected when put under lot of stress and load. </p>  <p>· As a performance engineer, you will be able to do effective performance (load/stress) testing of web services along with validating their behaviour. </p>  <p>· As developer/consultant, you will be able to use web services automation as part of continuous Integration to improve the build and code quality. </p>  <p>· As a support engineer, you can also run automation tests quickly to find the culprit such an unintentional regression impact and that will help in debugging and troubleshooting critical failures. </p>  <p><a name="_Toc284684684"></a></p>  <h3><a name="_Toc284684659"></a><a name="_Toc311287842">Appendix</a></h3>  <p><font color="#000000" size="4" face="Arial">i. Getting Started with VS 2010 Unit Test &amp; Web Test</font></p>  <blockquote>   <h4><a href="http://msdn.microsoft.com/en-us/library/ms182532.aspx"><font size="3" face="Arial">Walkthrough: Creating and Running Unit Tests</font></a><a name="_Toc311287844"></a></h4>    <h4><a href="http://msdn.microsoft.com/en-us/library/aa337591.aspx"><font size="3" face="Arial">Web Performance Test Walkthroughs</font></a><a name="_Toc311287845"></a></h4>    <h4><a href="http://msdn.microsoft.com/en-us/magazine/cc700338.aspx"><font size="3" face="Arial">Introduction to WCF Testing</font></a><a name="_Toc311287846"></a></h4> </blockquote>  <h4><a name="_Toc311287847"></a><a name="_Deploying_Sample_Web"></a><font color="#000000" size="4" face="Arial">ii. Deploying Sample Web Services Application</font></h4>  <p>Please find below the steps to get started with our sample web services </p>  <h5><a name="_Toc311287848">Step 1: Deploy sample DB</a></h5>  <p>From our sample solution, run <b>Create_Sample_DB.sql</b> which will create the Database and Tables required for our sample app. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7888.image_6D77FBF1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7888.image_5F00_6D77FBF1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5734.image_thumb_7CCB^.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5734.image_5F00_thumb_5F00_7CCB5E00.png" width="491" height="329" /></a> </p>  <h5><a name="_Toc311287849">Step 2. Deploy our services</a></h5>  <p><b>a) </b><b>Sample WCF Service – </b></p>  <p>This project contains the WCF services will be consumed by <b>Sample_APP_UI</b>. It contains the contract as well as the implementation of the contracts. This project also uses the LinQ feature for integration with the database. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7384.image_0CAA7CF8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7384.image_5F00_0CAA7CF8.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2021.image_thumb_6BB70A50.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2021.image_5F00_thumb_5F00_6BB70A50.png" width="327" height="447" /></a> </p>  <p>Below is sample step to deploy services on your machine </p>  <p>i) Launch solution and publish “<b>WcfService</b>” project to FileSystem </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5635.image_45450138.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5635.image_5F00_45450138.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7384.image_thumb_482A401E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7384.image_5F00_thumb_5F00_482A401E.png" width="396" height="388" /></a>&#160; </p>  <p>ii) Add an application to your IIS and provide the File system directory and App pool details </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2514.image_3FB644FA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2514.image_5F00_3FB644FA.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0535.image_thumb_0416363A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0535.image_5F00_thumb_5F00_0416363A.png" width="409" height="296" /></a>&#160; </p>  <p>iii) Browse and test your services in browser or using WCFTestClient </p>  <p><b><i>Browser</i></b><i>: From IIS, select your application and press Browse</i> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7713.image_395F489F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7713.image_5F00_395F489F.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7318.image_thumb_642786E4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7318.image_5F00_thumb_5F00_642786E4.png" width="430" height="461" /></a> </p>  <p><b><i>WCFTestClient</i></b><i>:</i> </p>  <p>- <i>Launch VS Command Prompt and type WCFTESTCLIENT</i> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8321.image_71E9A712.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8321.image_5F00_71E9A712.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8715.image_thumb_1AA50C5C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8715.image_5F00_thumb_5F00_1AA50C5C.png" width="485" height="108" /></a> </p>  <p><i></i></p>  <p>- <i>Add URL of your web service </i></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6761.image_6D43768B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6761.image_5F00_6D43768B.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8308.image_thumb_1375AA17.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8308.image_5F00_thumb_5F00_1375AA17.png" width="539" height="283" /></a> </p>  <p><i></i></p>  <p>- <i>Click on any test method, provide request parameter and invoke</i> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/7737.image_15828313.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/7737.image_5F00_15828313.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2134.image_thumb_589DDB73.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2134.image_5F00_thumb_5F00_589DDB73.png" width="545" height="263" /></a> </p>  <p><i></i></p>  <p><i></i></p>  <p><b>b) </b><b>Sample ASMX Web Services</b> </p>  <p>This project contains the services which are built on ASMX types. These services are also consumed by the <i>Sample_App_UI.</i><b></b> </p>  <p>For deployment follow the steps given in above step (a). </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5773.image_0178CAB0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5773.image_5F00_0178CAB0.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3630.image_thumb_7261EBD5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3630.image_5F00_thumb_5F00_7261EBD5.png" width="385" height="346" /></a> </p>  <p><i>Note: You can skip this as well if your scope doesn’t include testing ASMX based services</i> </p>  <p><b></b></p>  <p><b>c) </b><b>Sample Windows Workflow Foundation Services</b> </p>  <p>This project contains the sample WCF service which is consumed by the workflow application. </p>  <p>For deployment follow the steps given in above step (a). </p>  <p><i>Note: You can skip this as well if your scope doesn’t include testing Workflow based services</i> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2061.image_05DF25AA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2061.image_5F00_05DF25AA.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2475.image_thumb_0506BFC0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2475.image_5F00_thumb_5F00_0506BFC0.png" width="261" height="267" /></a> </p>  <p><b></b><b></b></p>  <p><b></b></p>  <p><b>d) </b><b>Sample Authentication Project</b> </p>  <p>This project contains the WCF service which entails the authenticate service. We have used the “<i>UserNamePasswordValidator</i>” validate method for the verification of the client credentials to authenticate the client. </p>  <p>The main intent is to check the authentication of the client, so this service has 1 contract implemented “GetServertime” which returns the current time at the server. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1401.image_39E39F30.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1401.image_5F00_39E39F30.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4544.image_thumb_3FBE42C9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4544.image_5F00_thumb_5F00_3FBE42C9.png" width="250" height="265" /></a> </p>  <p><i>Note: You can skip this as well if your scope doesn’t include testing Authentication of your services</i> </p>  <p><b>e) </b><b>Sample Non-XML Data Project</b> </p>  <p>This project contains the WCF service which is required for returning the non xml data from the service. For this case we are using the service to return the image file using the stream. </p>  <p>There are two response from the service implemented under this project. </p>  <p>- Buffered response </p>  <p>- Streamed response </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1004.image_10ABE125.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1004.image_5F00_10ABE125.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/1423.image_thumb_13DDC90D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/1423.image_5F00_thumb_5F00_13DDC90D.png" width="394" height="296" /></a> </p>  <p><i>Note: You can skip this as well if your scope doesn’t include testing of Non-XML based response from web services</i> </p>  <p><b>f) </b><b>Sample Web Services Caching Project</b> </p>  <p>This project contains a WCF service which contains the service representing the cache behaviour of the WCF service. For this project we have leveraged the Asp.Net cache in the WCF. The response is cached for 60 seconds if the request URL doesn’t changes. On changing the parameter to the request URL or elapse of 60 seconds the call again to this service returns the fresh response from the service. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2806.image_4DBCE62C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2806.image_5F00_4DBCE62C.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8272.image_thumb_539789C5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8272.image_5F00_thumb_5F00_539789C5.png" width="326" height="308" /></a> </p>  <p><i>Note: You </i><i>can skip this as well if your web services don’t use caching</i> </p>  <p><b>g) </b><b>Sample Asynchronous Web Services Project </b></p>  <p>This project shows another feature of the WCF asynchronous call where in client sends a request to the server and continues with the regular task and on completion of the service i.e. response comes from server the required action is performed using the response received. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5732.image_1C2152CA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5732.image_5F00_1C2152CA.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3580.image_thumb_53F396ED.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3580.image_5F00_thumb_5F00_53F396ED.png" width="325" height="323" /></a> </p>  <p>For this example we have used client making the <i>Asynchronous </i>call using the call-back mechanism. This project contains the contract as well as the Windows client which uses the service return. </p>  <p><i>Note: You can skip this as well if your web services don’t use Asynchronous calls</i> </p>  <h5><a name="_Toc311287850">Step 3. Run Sample Client apps</a></h5>  <p><b></b></p>  <p><b>a) </b><b>Sample UI application</b> </p>  <p>This is the main project in the solution which consumes different services WCF and ASMX. This project is a sample app to demonstrate the services when consumed from UI and their return </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2821.image_071FAA8A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2821.image_5F00_071FAA8A.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5226.image_thumb_064744A0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5226.image_5F00_thumb_5F00_064744A0.png" width="383" height="345" /></a> </p>  <p><i>Note: Please update the service reference to point to the URL of the our sample web services (WCF and ASMX) as shown below by using “Configure service reference”</i> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0842.image_272A917A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0842.image_5F00_272A917A.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2425.image_thumb_10A7CD26.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2425.image_5F00_thumb_5F00_10A7CD26.png" width="443" height="304" /></a> </p>  <p>You can now run sample UI app that consumes WCF and ASMX based services. </p>  <p><b>b) </b><b>Sample Authentication Console Application</b> </p>  <p>This project in the solution contains the client which will test service, and provide the valid credentials so that the service returns the valid return. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/6138.image_3D8D0A34.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/6138.image_5F00_3D8D0A34.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4578.image_thumb_6AA1F702.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4578.image_5F00_thumb_5F00_6AA1F702.png" width="255" height="182" /></a> </p>  <p>This is a console based application which hosts the Auth_Service and send the valid credentials to test it. </p>  <p><b>c) </b><b>Sample Workflow Console Application</b> </p>  <p>This is a Workflow project which uses the WCF services with in the workflow, and executes the rest of action in the workflow. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8272.image_01ECFB74.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8272.image_5F00_01ECFB74.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2402.image_thumb_0114958A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2402.image_5F00_thumb_5F00_0114958A.png" width="300" height="217" /></a> </p>  <p>This project is just a sample to be demonstrated on how the services are integrated with the WF app. </p>  <p>&#160; </p>  <h4><a name="_Toc276381721"></a><a name="_Toc311287851"></a><a name="_Automation_Estimation"></a><a name="_TFS_Check-in_Policies"></a><a name="_Getting_Started"></a><a name="_Managing__common"></a><font color="#000000" size="4" face="Arial">iii. Sample Restful Services</font></h4>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2844.image_3DE9175C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2844.image_5F00_3DE9175C.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0361.image_thumb_3D10B172.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0361.image_5F00_thumb_5F00_3D10B172.png" width="605" height="422" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3404.image_496EAECE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3404.image_5F00_496EAECE.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/4405.image_thumb_0CF63A24.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/4405.image_5F00_thumb_5F00_0CF63A24.png" width="618" height="204" /></a></p>  <p><i></i></p>  <p><i></i></p>  <p><i></i></p>  <h4><a name="_Toc311287852"><font color="#000000" size="4" face="Arial">iv. Request/Request XML for services not supported by Fiddler/ WCFTestClient</font></a></h4>  <p>Working on a project where we create WCF Services there may be a need to capture the raw xml passed in to the service operation and also capture the reply xml sent back by the service. Our reusable code captures raw xml even for the scenarios (e.g. Non Xml data being returned by service) where WCF Test Client or fiddler are not able to trace the request\response xml. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/2450.image_5D77A58A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/2450.image_5F00_5D77A58A.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3022.image_thumb_299F896C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3022.image_5F00_thumb_5F00_299F896C.png" width="631" height="442" /></a> </p>  <p><b>Reusable Code snippet:</b> </p>  <p>ImageServc.StreamingServiceClient ClientHandle = new ImageServc.StreamingServiceClient(); </p>  <p>ResponseXmlInterceptingBehavior responseXmlInterceptingBehaviour = new ResponseXmlInterceptingBehavior(); </p>  <p>ClientHandle.Endpoint.Behaviors.Add(responseXmlInterceptingBehaviour); </p>  <p>OutputFile = ClientHandle.GetData(&quot;Dryden&quot;); </p>  <p>string requestXml = responseXmlInterceptingBehaviour.ResponseXmlInterceptor.RequestXml; </p>  <p>&#160; </p>  <h4><a name="_Toc311287853"><font color="#000000" size="4" face="Arial">v. Binding &amp; Hosting configuration &amp; consideration</font></a></h4>  <p>This project one of the features of WCF to host the WCF service on the console. In this project we have used the basic test for the call of contract/method of WCF which is hosted on the console app. </p>  <p>Please refer the snapshot which will give you an idea on hosting the service on the console. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/0317.image_74A25E61.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/0317.image_5F00_74A25E61.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/5826.image_thumb_0F3ED4AE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/5826.image_5F00_thumb_5F00_0F3ED4AE.png" width="627" height="373" /></a> </p>  <p>Another sample unit test </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/8640.image_5FFCC349.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/8640.image_5F00_5FFCC349.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/73/metablogapi/3750.image_thumb_7596FBE6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-73-metablogapi/3750.image_5F00_thumb_5F00_7596FBE6.png" width="641" height="362" /></a> </p>  <h4>&#160;</h4>  <h4><a name="_Toc311287854"><font color="#000000" size="4" face="Arial">vi. Data driven testing</font></a></h4>  <p>Use below link if you need more information about Data driven testing using Coded UI and access/store data in MS EXCEL from Coded UI </p>  <p><a href="http://blogs.msdn.com/b/mathew_aniyan/archive/2009/03/17/data-driving-coded-ui-tests.aspx">Data Driven Testing by Mathew</a> </p>  <p><a href="http://msdn.microsoft.com/en-us/library/ee624082(VS.100).aspx">http://msdn.microsoft.com/en-us/library/ee624082(VS.100).aspx</a> </p>  <p><a href="http://msdn.microsoft.com/en-us/magazine/cc163536.aspx">http://msdn.microsoft.com/en-us/magazine/cc163536.aspx</a><a name="_Managing_object_repository"></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Web Services Test Automation Guidance using VS 2010 - Unit Test &amp; Web Test</title>
      <link>https://docs.microsoft.com/archive/blogs/geektester/web-services-test-automation-guidance-using-vs-2010-unit-test-web-test</link>
      <pubDate>Sat, 10 Dec 2011 07:53:11 GMT</pubDate>
      <dc:creator><![CDATA[raj.kamal13]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/geektester/2011/12/10/web-services-test-automation-guidance-using-vs-2010-unit-test-web-test/</guid>
      <description><![CDATA[All your wait is over. Finally its out :)&nbsp;&nbsp;...]]></description>
      <content:encoded><![CDATA[<p>All your wait is over. Finally its out :)&nbsp;&nbsp; <a title="http://www.webservicestesting.codeplex.com/" href="http://www.webservicestesting.codeplex.com/">http://www.webservicestesting.codeplex.com/</a></p>
<p>&lt;&lt;Please refer to Web Services Automation Guidance (VS 2010 Unit Test <br />&amp; Web Test).PDF <a href="http://webservicestesting.codeplex.com/releases/view/78473#DownloadId=312126">http://webservicestesting.codeplex.com/releases/view/78473#DownloadId=312126</a> <br />for detailed documentation&gt;&gt;</p>
<p><a href="file:///C:/Users/rajkamal/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles9B76C/clip_image001[11].jpg"></a><a href="file:///C:/Users/rajkamal/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles9B76C/clip_image001[11].jpg"></a></p>
<p>The artifact will provide Web Services Automation guidance for Functional <br />&amp; Performance Testing leveraging VS 2010. The document will provide <br />recommendation on using either Unit Test or Web Test for functional testing <br />depending on your project and test objective as will be later covered in the <br />document. Load Test will be used for Performance Testing in both cases.</p>
<p>The primary objective is to propose a viable web services test automation <br />approach &amp; reusable libraries to customers, partners and consultant. It will <br />also be a step in standardizing web services automation using VS 2010 platform <br />across the Industry and filling the gaps by extending our tools as suggested in <br />the talk. The document can also be used as a quick jump start guide for <br />beginners to get started on Web Services Automation Testing.</p>
<p>Have fun guys. We want to hear from you.</p>
<p>Thanks,</p>
<p>Raj, Vipul, Ranjit &amp;&nbsp; Gunjan</p>]]></content:encoded>
    </item>
  </channel>
</rss>