<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Vishnu's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/vishnus_blog/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/vishnus_blog/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:54:08 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Coded UI Test not able to interact with the desktop</title>
      <link>https://docs.microsoft.com/archive/blogs/vishnus_blog/coded-ui-test-not-able-to-interact-with-the-desktop</link>
      <pubDate>Sun, 05 May 2013 10:08:00 GMT</pubDate>
      <dc:creator><![CDATA[Vishnu [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vishnus_blog/2013/05/05/coded-ui-test-not-able-to-interact-with-the-desktop/</guid>
      <description><![CDATA[If you are running into the following error, Please read the options to enable Coded UI Tests on a...]]></description>
      <content:encoded><![CDATA[<p>If you are running into the following error, Please read the options to enable Coded UI Tests on a remote machine.</p>
<p><span style="color: #ff0000;"><em>Error calling Initialization method for test class NewTitlesPush.NewTitlesPush: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: Automation engine is unable to playback the test because it is not able to interact with the desktop.&nbsp; This could happen if the computer running the test is locked or it&rsquo;s remote session window is minimized.</em></span></p>
<p>&nbsp;</p>
<p>For the UI tests, the active desktop session has to be opened. We have faced this issue and we have couple of solutions</p>
<p>1. Open a Hyper-V session onto the machine where the UI Tests are running. You can minimize the hyper-V window and the tests will still run fine.</p>
<p>2. If you are running tests in a Lab Environment created from Microsoft Test Manager, Run the tests and open LEViewer[Lab Environment Viewer] to keep the desktop session active.</p>
<p>3. Enable AutoLogon on the&nbsp;machine where the tests are running and restart the machine. Then you don't need to do remote desktop - <a href="https://support.microsoft.com/kb/310584">https://support.microsoft.com/kb/310584</a></p>
<p>&nbsp;</p>
<p>Thanks,</p>
<p>Vishnu</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Running VS 2010 SP1 Coded UI Tests on VS 2012 Test Agents</title>
      <link>https://docs.microsoft.com/archive/blogs/vishnus_blog/running-vs-2010-sp1-coded-ui-tests-on-vs-2012-test-agents</link>
      <pubDate>Tue, 09 Apr 2013 11:23:00 GMT</pubDate>
      <dc:creator><![CDATA[Vishnu [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vishnus_blog/2013/04/09/running-vs-2010-sp1-coded-ui-tests-on-vs-2012-test-agents/</guid>
      <description><![CDATA[To run VS 2010 SP1 Coded UI Tests using VS 2012 Test Agents, these are the requirements
1. Coded UI...]]></description>
      <content:encoded><![CDATA[<p>To run VS 2010 SP1 Coded UI Tests using VS 2012 Test Agents, these are the requirements</p>
<p>1. Coded UI test projects should be opened in VS 2012. This auto-upgrades the test project to VS 2012. The upgrade test project is compatible with VS 2010 SP1 as well. If the test project is not upgraded, then you might hit&nbsp;the below&nbsp;error</p>
<p><em><span style="color: #ff0000;">Unit Test Adapter threw exception: Could not load file or</span></em><br /><em><span style="color: #ff0000;">assembly 'Microsoft.VisualStudio.QualityTools.CodedUITestFramework,</span></em><br /><em><span style="color: #ff0000;">Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of</span></em><br /><em><span style="color: #ff0000;">its dependencies. The system cannot find the file specified..</span></em></p>
<p>2. Build Agent should be of version TFS 2012 with VS 2012 installed</p>
<p>3. VS 2012 Test Controller and VS 2012 Test Agents should be registered with TFS 2012.</p>]]></content:encoded>
    </item>
    <item>
      <title>Silverlight 5.0 Support</title>
      <link>https://docs.microsoft.com/archive/blogs/vishnus_blog/silverlight-5-0-support</link>
      <pubDate>Thu, 18 Oct 2012 04:29:42 GMT</pubDate>
      <dc:creator><![CDATA[Vishnu [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vishnus_blog/2012/10/18/silverlight-5-0-support/</guid>
      <description><![CDATA[Few months back, We had added support for Silverlight 5.0 applications.
Please check out the plugin...]]></description>
      <content:encoded><![CDATA[<p>Few months back, We had added support for Silverlight 5.0 applications.</p>
<p>Please check out the plugin at <a href="https://visualstudiogallery.msdn.microsoft.com/28312a61-9451-451a-990c-c9929b751eb4">https://visualstudiogallery.msdn.microsoft.com/28312a61-9451-451a-990c-c9929b751eb4</a></p>]]></content:encoded>
    </item>
    <item>
      <title>How to access Test Case Manager Test Case ID</title>
      <link>https://docs.microsoft.com/archive/blogs/vishnus_blog/how-to-access-test-case-manager-test-case-id</link>
      <pubDate>Tue, 29 Mar 2011 13:12:00 GMT</pubDate>
      <dc:creator><![CDATA[Vishnu [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vishnus_blog/2011/03/29/how-to-access-test-case-manager-test-case-id/</guid>
      <description><![CDATA[In Visual Studio 2010, we can create test cases using Microsoft Test Manager and can associate...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;">In Visual Studio 2010, we can create test cases using Microsoft Test Manager and can associate automation to these test cases. During the test method execution, we might need the test case Id of the test case for various reasons.</span></span></span></span></p>
<p><span style="font-size: small;"><span style="color: #1f497d;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #000000;">Unfortunately, the TESTCONTEXT doesn&rsquo;t expose the Test Case Management context that you could use from the Test Method itself.</span></span></span><span style="color: #1f497d;"><o:p><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #000000;">&nbsp;</span></span></o:p></span></span></p>
<p class="MsoListParagraph"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;"><span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>Write a custom data collector. This article will help in writing a simple custom data collector - </span><a href="https://blogs.microsoft.co.il/blogs/shair/archive/2010/04/19/how-to-create-custom-datacollector-in-visual-studio-2010-part-1.aspx"><span style="color: #0000ff;"><span style="font-size: small;">https://blogs.microsoft.co.il/blogs/shair/archive/2010/04/19/how-to-create-custom-datacollector-in-visual-studio-2010-part-1.aspx</span></span></a><o:p></o:p></span></span></span></p>
<p class="MsoListParagraph"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;"><span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>From the custom data collector's event handler, you could access the Test Case Management Context like below.<o:p></o:p></span></span></span></span></p>
<p class="MsoNormal"><span style="color: #7030a0; font-size: 9.5pt;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;">private void OnTestCaseStart(object sender, TestCaseStartEventArgs e)<o:p></o:p></span></span></span></span></span></p>
<p class="MsoNormal"><span style="color: #7030a0; font-size: 9.5pt;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;">{<o:p></o:p></span></span></span></span></span></p>
<p class="MsoNormal"><span style="color: #7030a0; font-size: 9.5pt;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try<o:p></o:p></span></span></span></span></span></p>
<p class="MsoNormal"><span style="color: #7030a0; font-size: 9.5pt;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></span></span></span></span></p>
<p class="MsoNormal"><span style="color: #7030a0; font-size: 9.5pt;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File.WriteAllText(@"C:\MTM_TC_Association\TestCaseID.txt", <span style="background: yellow; mso-highlight: yellow;">e.TcmInformation.TestCaseId</span>.ToString());<o:p></o:p></span></span></span></span></span></p>
<p class="MsoNormal"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<o:p></o:p></span></span></span></span></p>
<p class="MsoNormal"><span style="color: #7030a0; font-size: 9.5pt;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;">}<o:p></o:p></span></span></span></span></span></p>
<p><span style="font-size: small;">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Assigning Unique AutomationId for Silverlight XAML Controls</title>
      <link>https://docs.microsoft.com/archive/blogs/vishnus_blog/assigning-unique-automationid-for-silverlight-xaml-controls</link>
      <pubDate>Tue, 21 Dec 2010 06:57:00 GMT</pubDate>
      <dc:creator><![CDATA[Vishnu [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vishnus_blog/2010/12/21/assigning-unique-automationid-for-silverlight-xaml-controls/</guid>
      <description><![CDATA[If you want to run coded UI tests or create action recordings for your Silverlight 4 application,...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">If you want to run coded UI tests or create action recordings for your Silverlight 4 application, you must have a unique automation property that identifies each control. For more information about how to set up your Silverlight application so that the controls are recognized, see </span><a href="https://msdn.microsoft.com/en-us/library/gg313838.aspx"><span style="font-size: small;">How to: Set Up Your Silverlight Application for Testing</span></a><span style="font-size: small;">.</span></p>
<h3 xmlns="https://www.w3.org/1999/xhtml" class="subHeading"><span style="font-size: medium;">Static XAML Definition</span></h3>
<div xmlns="https://www.w3.org/1999/xhtml" class="subsection">
<p><span style="font-size: small;">To specify a unique automation property for a control that is defined in your XAML file, you can set the AutomationProperties.AutomationId or AutomationProperties.Name implicitly or explicitly, as shown in the following examples. Setting either of these values gives the control a unique automation property that can be used to identify the control when you create a coded UI test or action recording.</span></p>
<p><strong><span style="font-size: small;"><span class="label">Set the Property Implicitly</span> </span></strong></p>
<p><span style="font-size: small;">Set the AutomationProperties.AutomationId to <span class="input">ButtonX</span> using the Name property in the XAML for the control.</span></p>
<p><span style="font-size: small;">&lt;Button Name="ButtonX" Height="31" HorizontalAlignment="Left" Margin="23,26,0,0"&nbsp; VerticalAlignment="Top" Width="140" Click="ButtonX_Click" /&gt;</span></p>
<p><strong><span style="font-size: small;"><span class="label">Set the Property Explicitly</span> </span></strong></p>
<p><span style="font-size: small;">Set the AutomationProperties.AutomationId to <span class="input">ButtonX</span> explicitly in the XAML for the control.</span></p>
<p><span style="font-size: small;">&lt;Button AutomationProperties.AutomationId=&ldquo;ButtonX&rdquo; Height="31" HorizontalAlignment="Left" Margin="23,26,0,0"&nbsp; VerticalAlignment="Top" Width="140" Click="ButtonX_Click" /&gt;</span></p>
<p><span style="font-size: small;">&nbsp;</span></p>
<p><strong><span style="font-size: medium;"><span style="text-decoration: underline;">Assigning AutomationId using UpdateAID tool</span></span></strong></p>
<p><span style="font-size: small;">To simplify the process of assigning unique AutomationId, we have built a small tool that will help, when there are many static XAML controls in your silverlight application project. The steps to add the AutomationId are given below</span></p>
<p><span style="font-size: small;"><strong>Step 1</strong>. Build the Silverlight Application Project by specifying the "UpdateUid" switch</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp; msbuild /t:UpdateUid &lt;SilverlightApplication1.csproj&gt;&nbsp;&nbsp; </span></p>
<p><span style="font-size: small;">&nbsp;&nbsp; Please note that the switch applies only to the CSPROJ and not to the SLN file of the project. This creates an XAML directive "x"Uid" with an unique Uid for every XAML control. </span></p>
<p><span style="font-size: small;">&nbsp;&nbsp; Say your SilverlightApplication1 project contains only the following XAML content</span></p>
<p><span style="font-size: small;"><span style="color: #0000ff;">&nbsp;&nbsp;&nbsp;&nbsp; &lt;Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="186,90,0,0" Name="button1" VerticalAlignment="Top" Width="75"&nbsp; /&gt;</span>&nbsp;&nbsp; </span></p>
<span style="font-size: x-small;">
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;"><span style="font-size: small;">&nbsp;&nbsp;<span style="color: #000000;"> After building with UdpateUid switch, the XAML content will be as below with the highlighted part added</span></span></span></span></span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">&lt;Button <span style="background-color: #ffff00;">x:Uid="button1"</span> Content="Button" Height="23" HorizontalAlignment="Left" Margin="186,90,0,0" Name="button1" VerticalAlignment="Top" Width="75"&nbsp; /&gt;</span>&nbsp;&nbsp; </span></p>
<p><span style="font-size: small;"><span style="font-size: small;"><strong>Step 2</strong>. The attached&nbsp;file UpdateAID.zip&nbsp;contains both the source(UpdateAIDToolSource.zip) of the tool as well as the compiled EXE(UpdateAIDTool.zip). Unzip the UpdateAIDTool.zip file to a folder. </span></span></p>
<p><span style="font-size: small;"><span style="font-size: small;">Now the folder should contain two files - 1. UpdateAIDTool.exe 2. ControlList.txt</span></span></p>
<p><span style="font-size: small;"><span style="font-size: small;"></span></span><span style="font-size: small;"><strong>Step 3.</strong> Check if you have the desired list of controls in ControlList.txt file. You can remove or add more controls as you need. We suggest specifying the full control type name as it is in the XAML.</span></p>
</span><span style="font-size: small;"></span>
<p><span style="font-size: small;"><strong>Step 4</strong>. From command prompt,&nbsp;run the following command</span></p>
<p><span style="font-size: small;">&nbsp; &gt;&gt;&nbsp;UpdateAIDTool.exe &lt;Silverlight Project top directory&gt; </span></p>
<p><span style="font-size: small;">The tool adds the "AutomationProperties.AutomationId" property for all the XAML controls that had the Uid directive set earlier. After this, the XAML content will be as below&nbsp;with the highlighted part added</span></p>
<p><span style="font-size: x-small;"><span style="font-size: small;">&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;"><span style="font-size: small;">&lt;Button x:Uid="button1" Content="Button" Height="23" HorizontalAlignment="Left" Margin="186,90,0,0" Name="button1" VerticalAlignment="Top" Width="75" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background-color: #ffff00;">AutomationProperties.AutomationId="button1"</span> /&gt;</span></span></span></p>
<p><span style="font-size: small;">For Silverlight controls other than the static XAML controls, please refer this article to know how to assign unique Automation ID - <a href="https://msdn.microsoft.com/en-us/library/gg413373.aspx">https://msdn.microsoft.com/en-us/library/gg413373.aspx</a></span></p>
</div>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/10/76/59/UpdateAID.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-10-76-59/UpdateAID.zip">UpdateAID.zip</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>