<?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>Ganesh’s Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ganesh/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ganesh/feed.xml</link>
    <description>My { Study | Outlook | Interpretation }</description>
    <lastBuildDate>Tue, 06 Mar 2018 16:25:26 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How not to write Xamarin UI Test !</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/how-not-to-write-xamarin-ui-test</link>
      <pubDate>Sat, 24 Feb 2018 04:33:07 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=1855</guid>
      <description><![CDATA[Here in this blog, i will discuss about the experience while using Xamarin UI Test for iOS/Android...]]></description>
      <content:encoded><![CDATA[<p class="p1">Here in this blog, i will discuss about the experience while using Xamarin UI Test for iOS/Android apps.</p>
<p class="p1"><b>What is Xamarin UI Test?</b></p>
<p class="p1">Xamarin UI Test is an automation framework based on Calabash, C# and NUnit. This can be used to automate mobile applications like iOS/Android.</p>
<p class="p1"><b>Why?</b></p>
<p class="p1">For an engineer who is comfortable with C#, this is the best framework that can be used to automate the mobile apps developed on hybrid/native apps.</p>
<p class="p1"><b>How?</b></p>
<p class="p1">You can go through this <a href="https://developer.xamarin.com/guides/testcloud/uitest/"><span class="s1">link</span></a> to know more about Xamarin UI Test.</p>
<p class="p1"><b>Tips &amp; Tricks!</b></p>

<ol class="ol1">
 	<li class="li1">What if your app contains multiple pages!  You can definitely use a <em>page object pattern</em> framework which comes along with the nuget Package. You can find the sample <a href="https://github.com/xamarin-automation-service/uitest-pop-example"><span class="s1">here</span></a>.</li>
 	<li class="li1"><em>Thread.Sleep!</em> Undoubtedly Polling is bad. Xamarin UI Test gives us many methods to stop polling.<span class="s2"> Here is a sample where the app waits until the button is enabled:</span></li>
</ol>
<pre class="p2"><span class="s2"><b> </b></span><b>app.WaitFor(() =&gt; app.Query(e =&gt; e.Class(</b><span class="s3"><b>"UIButton"</b></span><b>).Index(</b><span class="s3"><b>1</b></span><b>)).First().Enabled, </b><span class="s4"><b>"Waiting for Element"</b></span><b>, timeout: </b><span class="s5"><b>TimeSpan</b></span><b>.FromMinutes(</b><span class="s3"><b>3.0</b></span><b>));</b><span class="s6"><b> </b></span><b>
 </b></pre>
<p class="p2">      3. Code without <em>Assertions</em> ?? Never! You can use the same assertions that you use for Nunit. Like Assert, StringAssert,FileAssert, CollectionAssert.</p>
      4. How to Identify Elements like datepicker? You can use <em>invoke</em> method on the element
<pre class="p3"><b>app.Query (x =&gt; x.Class ("UIPickerView").Invoke ("selectRow", date.Month - 1 , "inComponent", 0, "animated", true));</b></pre>
<p class="p1">      5. How to add <em>test case category</em> ?? Yes, you can! Why would someone add a test category? It not only helps in identifying the test case no. but also when you have a CI pipeline, you can categorize the test methods to run specific tests.</p>

<pre class="p3"><b>[Category("Test Category Name")]</b></pre>
<p class="p1">     6. How to <em>start writing the test</em>? Always open the repl mode and use app.flash to identify the element. After you play with the repl mode, Just type "copy" and paste it in your test method. Remove the unwanted code. "Tree" keyword is used to identify the structure of elements in the UI. And the repl mode is really interactive and supports intellisense.</p>
    7. I am <em>not able to find elements</em> in repl ! If you are trying to use class, sometimes it hardly gives any result.. so try classful ! And there are many implicit methods which works efficiently to capture the element.

8. Can i check the app's <em>memory leak</em> issues? Yes ! you can use backdoor methods in the app to trace the managed and unmanaged memory. For a long running test, this is much helpful. Alternatively you can use Xamarin Profiler too.

9. <em>Automate a webview</em> inside a native app? Some apps use web based login to authenticate the user. We still have the provision to use Webview() to automate those functionalities. It supports Xpath too !

10. I need to create more data and use assertion. Can i use data driven test ? Yes definitely, CSV or Xml or JSon.

11. I want to run my UI Test in my device along with my regular builds. Is it possible ? Yes we can use cake addins to perform CI integration. Alternatively you can use <a href="https://www.visualstudio.com/app-center/">app center</a> to have e2e mobile app dev/test/deploy.

<strong>Common Troubleshooting with iOS apps</strong>
<ol>
 	<li><span><em>Unable to contact test backend running in app. A common cause is that the app is not properly linked</em> - You need to check the Xamarin.TestCloud.Agent (to be latest based on the Xcode) or Xamarin.Calabash component is missing from the appdelegate.cs.</span></li>
 	<li>I upgraded all the packages but my test is not running ! You should use NUnit Version below 3.0.0, ideally to use 2.6.4 unless there is any update. Sometimes Xamarin UI Tests doesn't work well with iOS upgrades. So wait for sometime until the Xcode/Xamarin support is provided.</li>
 	<li>I am not able to <em>deploy the device agent</em>. Check the version of Xamarin.TestCloud.Agent, Xamarin.UITest. If there was an iOS update, the Xcode needs to be updated (if not available use the preview version).</li>
 	<li><span><em>System.Net.Http.HttpRequestException</em> - Sometimes you get this error in repl mode. Try reconnecting the device and run the repl again.</span></li>
 	<li> <em>Not able to view the tests</em>. This is a common issue which we observe in visual studio for mac. You can rebuild the solution, Quit Visual Studio (Command+Q) and then re-open to view the tests.</li>
</ol>
Please feel free to post any queries below !]]></content:encoded>
    </item>
    <item>
      <title>Postman – Continuous Integration with TFS/VNext Builds</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/postman-continuous-integration-with-tfsvnext-builds</link>
      <pubDate>Sat, 26 Aug 2017 03:22:23 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=1815</guid>
      <description><![CDATA[Here is a walk through of cookbook to perform continuous integration of Postman Tests with TFS/VNext...]]></description>
      <content:encoded><![CDATA[Here is a walk through of cookbook to perform continuous integration of Postman Tests with TFS/VNext builds.

<strong>PreRequisite</strong>:
<ol>
 	<li>Postman - Create a json Project. (alternatively you can download from my Git <a href="https://github.com/ganesh-alalasundaram/PlugnPlay/blob/master/Sample.postman_collection.json">here</a>)</li>
 	<li>VSTS Account</li>
</ol>
<strong>Steps:</strong>
<ol>
 	<li>Goto Builds in Visual Studio online profile</li>
 	<li>Create a new build with a empty definition</li>
 	<li>Add <strong>npm</strong> Task</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2017/08/133.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/08/133-1024x356.png" alt="" class="alignnone size-large wp-image-1825" width="1024" height="356" /></a>

&nbsp;

4. Add a new <strong>command</strong> <strong>line</strong> Task. Pass the arguments as *.json file and with report as html options. More details on newman arguments can be found <a href="https://www.npmjs.com/package/newman">here</a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/218.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/08/218-1024x324.png" alt="" class="alignnone size-large wp-image-1826" width="1024" height="324" /></a>

&nbsp;

5. Click on <strong>Queue</strong> new build. Select the agent.

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/324.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/08/324.png" alt="" class="alignnone wp-image-1835" width="525" height="495" /></a>

&nbsp;

6. Once the build completes, verify the build steps. All should be passed.

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/415.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/08/415.png" alt="" class="alignnone wp-image-1837" width="768" height="454" /></a>

7.  <strong>Reports</strong>:

In the default path, the reports will be generated. Sample Report below.

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/512.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/08/512-1024x782.png" alt="" class="alignnone size-large wp-image-1846" width="1024" height="782" /></a>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>SoapUI - Continuous Integration with TFS/VNext Builds using TestRunner</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/soapui-continuous-integration-with-vnext-builds-using-testrunner</link>
      <pubDate>Wed, 23 Aug 2017 07:45:55 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=1615</guid>
      <description><![CDATA[Here is a walk through of cookbook to perform continuous integration of SoapUI Tests with VNext...]]></description>
      <content:encoded><![CDATA[Here is a walk through of cookbook to perform continuous integration of SoapUI Tests with VNext builds using TestRunner.

<strong>Pre-Requisites:</strong>

1. Install Ready API - With license from <a href="https://smartbear.com/product/ready-api/free-trial/">here</a>

2.Visual Studio Profile

<strong>Steps:</strong>

<strong>Create a SoapUI Project</strong>

1.Create a test suite in ReadyAPI tool. Have created a REST based project using the tutorial <a href="https://www.soapui.org/rest-testing/getting-started.html">here.</a>

2. Two test cases have been created, one which passes and another having a failure.

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/128.png"><img width="381" height="242" class="alignnone size-full wp-image-1625" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/08/128.png" /></a>

Test Case:1 with valid request and assertion.

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/215.png"><img width="1024" height="380" class="alignnone size-large wp-image-1635" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/08/215-1024x380.png" /></a>

Test Case: 2 with valid request and invalid assertion.

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/320.png"><img width="1024" height="489" class="alignnone size-large wp-image-1645" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/08/320-1024x489.png" /></a>

3. Run the test using the test runner and capture the command line highlighted which will be used in future. (Test Suite1 is captured here)

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/test-runner.png"><img width="1024" height="123" class="alignnone size-large wp-image-1685" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/08/test-runner-1024x123.png" /></a>

4. Save the project as *.xml in your local desktop.

<strong>Creating a Build Agent</strong>

In the below process, i have created a build agent targeting my local as i have installed my soapui(licensed) in my local machine.
<ol>
 	<li>Download agent from one of the agent queues in your visual studio account.</li>
 	<li>Configure your agent as mentioned below<a href="https://msdnshared.blob.core.windows.net/media/2017/08/agent.png"><img width="858" height="851" class="alignnone wp-image-1705" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/08/agent-1024x1016.png" /></a></li>
 	<li>In the config command, enter your visual studio server details and enter your authentication code.<a href="https://msdnshared.blob.core.windows.net/media/2017/08/config.png"><img width="842" height="392" class="alignnone size-full wp-image-1745" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/08/config.png" /></a></li>
</ol>
4. Type the Run command and it will establish the connectivity between your machine and visual studio agent.

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/67.png"><img width="944" height="373" class="alignnone size-full wp-image-1675" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/08/67.png" /></a>

&nbsp;

<strong>Create a Build Definition</strong>
<ol>
 	<li>Goto builds in your visual studio account.</li>
 	<li>Create a empty build definition</li>
 	<li>Add a Command Line Task</li>
 	<li>Point the tool to the testrunner.bat location in your local</li>
 	<li>Pass the testrunner arguments that you copied when you ran the test runner from SoapUI</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2017/08/build.png"><img width="1024" height="315" class="alignnone size-large wp-image-1755" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/08/build-1024x315.png" /></a>

6. Build the queue. In the Build Summary the link to the report will be available. You can copy the path and mail it to recipients using powershell scripts <a href="https://www.techrepublic.com/blog/windows-and-office/send-an-email-with-an-attachment-using-powershell/">here</a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/build-complete.png"><img width="1024" height="516" class="alignnone size-large wp-image-1765" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/08/build-complete-1024x516.png" /></a>

&nbsp;

<strong>Common Issues:</strong>

1.ReadyApi License is needed to run testrunner from command line.

2.The service account used to run the test in the build agent should be an administrator having access to all path in your system.

3.Command line in Visual Studio should be entered properly.

4. You can customize reports in testrunner. (html/junit reports). For junit reports you need to install ANT from <a href="https://ant.apache.org/manual/index.html">here</a>. And point to C:\ANT. Add this to Path variable in your System Environment variables.

Please comment here if you face any issues !

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Hands-On with Cognitive API - Text Language Detection &amp; Translation</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/experience-with-cognitive-api-text-language-detection-translation</link>
      <pubDate>Thu, 10 Aug 2017 07:03:03 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=1565</guid>
      <description><![CDATA[Microsoft Cognitive Services (formerly Project Oxford) are a set of APIs, SDKs and services...]]></description>
      <content:encoded><![CDATA[<p class="lf-text-block lf-block"><em>Microsoft Cognitive Services (formerly Project Oxford) are a set of APIs, SDKs and services available to developers to make their applications more intelligent, engaging and discoverable. Microsoft Cognitive Services expands on Microsoft’s evolving portfolio of machine learning APIs and enables developers to easily add intelligent features – such as emotion and video detection; facial, speech and vision recognition; and speech and language understanding – into their applications. Our vision is for more personal computing experiences and enhanced productivity aided by systems that increasingly can see, hear, speak, understand and even begin to reason. -- Courtesy - Microsoft</em><span class="lf-thread-btn"></span></p>
In simple terms, Cognitive API's are those that assist the users to perform an operation in a better way !

This <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account">site </a>will assist you in getting started with Cognitive Service in Azure. Primarily the API's are hosted in azure and consumption is through the cloud service. Hence the users can view more granular details on usage and analytics.

To start with, we will use the text and speech API to create an app. I just took an app from <a href="https://github.com/MicrosoftTranslator/CSharp-WPF-Example">https://github.com/MicrosoftTranslator/CSharp-WPF-Example</a> and wrote a new method to detect the language. This is implemented by calling the cognitive api by parsing the input text. API to be referred <em>"https://api.microsofttranslator.com/v2/Http.svc/Detect?text="</em>

<strong>Steps to follow:</strong>
<ol>
 	<li>Download the You can my sample app from https://github.com/ganesh-alalasundaram/PlugnPlay/tree/master/CognitiveApi_Sample</li>
 	<li>Open the Solution</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2017/08/soln.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/08/soln.png" alt="" class="alignnone wp-image-1575" width="382" height="297" /></a>

3. Enter the subscription key that you obtain from Azure.(You can refer <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account">here</a> to create the subscription)

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/subscription-key.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/08/subscription-key-1024x338.png" alt="" class="alignnone size-large wp-image-1585" width="1024" height="338" /></a>

&nbsp;

4. Run the App. Enter the text and click detect language - that gives you the language code.

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/119.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/08/119-1024x598.png" alt="" class="alignnone wp-image-1595" width="510" height="298" /></a>

Select a value from the dropdown and click translate button. This will translate the entered text to the target language.

<a href="https://msdnshared.blob.core.windows.net/media/2017/08/29.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/08/29-1024x610.png" alt="" class="alignnone wp-image-1605" width="515" height="307" /></a>]]></content:encoded>
    </item>
    <item>
      <title>Mobile Center: An E2E tool for Mobile App Build/Test/Deploy/Distribute in Cloud</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/mobile-center-an-e2e-tool-for-mobile-app-buildtestdeploydistribute-in-cloud</link>
      <pubDate>Thu, 15 Jun 2017 08:21:49 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=1335</guid>
      <description><![CDATA[Why?

Its been a dream for the mobile developers to have an integrated environment to build, test,...]]></description>
      <content:encoded><![CDATA[<strong>Why?</strong>

Its been a dream for the mobile developers to have an integrated environment to build, test, deploy and distribute the app. Microsoft has effectively implemented mobile center at the right time which would considerably reduce lot many manual effort for app deliverables.As the tool supports x-platform OS, its a boon for all the developers to use the features in an isolated environment.

<strong>How?</strong>

In this example, we will be running through a Android App sample developed in Xamarin Platform.

Prerequisite:

a. Xamarin native/form app in VSO.

b. Mobile center login.

1. Goto <a href="https://mobile.azure.com/">https://mobile.azure.com/</a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/210.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/210-1024x557.png" alt="" class="alignnone wp-image-1355" width="699" height="380" /></a>

2. Click "Add New" Select "Add New app" or "Add new organization"
Add new app - creates an app platform on the same account page
Add new organization - use this when you want to isolate the development for a group of stakeholders. (You can configure People/distribution to a particular group)

3. Goto "Getting Started" Page.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/33.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/33-1024x588.png" alt="" class="alignnone wp-image-1365" width="699" height="401" /></a>

Copy the Code and Paste in in MainActivity.CS file of your android Solution.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/43.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/43-1024x342.png" alt="" class="alignnone wp-image-1375" width="702" height="235" /></a>

&nbsp;

<strong>Building the App</strong>

1. Goto Build. Click Add new. Select the Service where the mobile application is developed
<a href="https://msdnshared.blob.core.windows.net/media/2017/06/51.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/51-1024x428.png" alt="" class="alignnone wp-image-1376" width="692" height="289" /></a>

2. Search for the VS Project and select it.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/61.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/61-1024x468.png" alt="" class="alignnone wp-image-1385" width="687" height="314" /></a>

&nbsp;

3. Select the branch from the Source and Choose the project for the build. We need to Sign the builds if those apk needs to run on the devices.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/81.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/81-1024x450.png" alt="" class="alignnone wp-image-1405" width="698" height="307" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/10.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/10-914x1024.png" alt="" class="alignnone wp-image-1425" width="510" height="571" /></a>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/9.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/9-1024x367.png" alt="" class="alignnone wp-image-1415" width="708" height="254" /></a>

Sample Build Result

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/111.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/111-1024x503.png" alt="" class="alignnone wp-image-1435" width="704" height="346" /></a>

<strong>Testing the App</strong>

As like Test Cloud, You can select a device from the list and run any UI Test (Calabash/Xamarin UI/Appium etc).

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/121.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/121-1024x238.png" alt="" class="alignnone wp-image-1436" width="702" height="163" /></a>

Click on <strong>New Test Run</strong> button. Select a device from the list. And click next.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/131.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/131-1024x557.png" alt="" class="alignnone wp-image-1437" width="702" height="382" /></a>

Select the Test Series and Test framework from list below.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/141.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/141-1024x559.png" alt="" class="alignnone wp-image-1445" width="701" height="383" /></a>

Install Node.js in your physical machine and run add the nuget pkg through command line.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/151.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/151-1024x560.png" alt="" class="alignnone wp-image-1455" width="705" height="386" /></a>

Run the mobile-center command in your command prompt. And you can observe the test status <a href="https://msdnshared.blob.core.windows.net/media/2017/06/cmd.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/cmd-1024x505.png" alt="" class="alignnone wp-image-1545" width="698" height="344" /></a>

In the UI, the test run's are updated and the screenshots are also taken during the run explicitly.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/161.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/161-1024x491.png" alt="" class="alignnone wp-image-1465" width="699" height="335" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/171.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/171-1024x446.png" alt="" class="alignnone wp-image-1475" width="700" height="305" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/18.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/18-1024x551.png" alt="" class="alignnone wp-image-1477" width="706" height="380" /></a>

Test Failures reports are available.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/19.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/19-1024x501.png" alt="" class="alignnone wp-image-1485" width="701" height="343" /></a>

<strong>Distribution Group</strong>

Select "Distribute" and click on "New Group".

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/211.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/211-1024x407.png" alt="" class="alignnone wp-image-1495" width="705" height="280" /></a>

And upload the APK file generated.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/221.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/221-1024x553.png" alt="" class="alignnone wp-image-1505" width="700" height="378" /></a>

Select a distribution group

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/231.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/231-1024x657.png" alt="" class="alignnone wp-image-1507" width="702" height="450" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/241.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/241-1024x556.png" alt="" class="alignnone wp-image-1516" width="702" height="381" /></a>

Once the APK is distributed, users will receive an E-mail to download the APK.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/20.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/20-1024x415.png" alt="" class="alignnone wp-image-1486" width="701" height="284" /></a>

You can view the Crashes.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/261.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/261-1024x549.png" alt="" class="alignnone wp-image-1535" width="700" height="375" /></a>

User is able to view the Analytics space where it shows the data vs App version and Date range. Many other charts that infer the usage is displayed

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/251.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/251-1024x559.png" alt="" class="alignnone wp-image-1525" width="702" height="383" /></a>

<strong>Troubleshooting</strong>
<ol>
 	<li>to use mobile center in command line, type "mobile-center login" and use your credentials which you used to login to mobile center.</li>
 	<li>"Unable to find the nunit.framework.dll in the assembly directory" - you may have to right-click on the nunit.framework reference and choose Local Copy for it to be included in the output directory.</li>
 	<li>Invalid assembly path - always put a '\' in your path if you donot have.</li>
 	<li>Latest Nunit framework is not supported.  You need to downgrade the version to 2.6.4<a href="https://msdnshared.blob.core.windows.net/media/2017/06/nuget.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/nuget-1024x315.png" alt="" class="alignnone wp-image-1555" width="796" height="245" /></a></li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>Xamarin Live : The path to test/deploy Apps Over Air !</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/xamarin-live-the-path-to-deploy-apps-over-air</link>
      <pubDate>Mon, 05 Jun 2017 08:55:09 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=1186</guid>
      <description><![CDATA[How it would be if you could able to deploy a mobile app without having wired connectivity between...]]></description>
      <content:encoded><![CDATA[How it would be if you could able to deploy a mobile app without having wired connectivity between your device and your machine. And that's the power of Xamarin Live ! You can deploy a mobile app to your device without a hardware connectivity ex. connecting your device to your machine with a USB.

<strong>Why</strong> !
<ol>
 	<li>Its sometimes tricky to troubleshoot device related issues like upgrading or installing the drivers</li>
 	<li>Emulators are being heavy weight applications and face issues in running in low configured machines</li>
 	<li>Process of creating an appx/ipa/apk and then deploying in the device to verify the changes takes much longer time</li>
</ol>
<strong>Pre-Requisite</strong>
<ol>
 	<li>Download <a href="https://www.visualstudio.com/vs/preview/">visual studio preview version 2017.</a>  If you are a individual developer, you can use <strong>Community Edition</strong> which is free of cost and if you are a small enterprise go for <strong>Professional</strong> or a big enterprise go ahead with <strong>Enterprise</strong> version. Ensure you have selected "xamarin remoted simulator" option below during installation</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2017/06/12.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/12-1024x572.png" alt="" class="alignnone wp-image-1196" width="603" height="330" /></a>

2. Download <a href="https://marketplace.visualstudio.com/items?itemName=Xamarin.XamarinUpdater">Xamarin updater</a> and follow the steps available in that link.

3. Have a physical Android or iOS device connected to wifi/LTE.

4. Install Android Xamarin live player from <a href="https://play.google.com/store/apps/details?id=com.xamarin.live&amp;hl=en">here </a>and iOS live player from <a href="https://itunes.apple.com/us/app/xamarin-live-player/id1228841832?mt=8">here</a>.

&nbsp;

Its not mandate to know hardcore native OS development like Swift or Android java when you use Xamarin. A C# developer can easily start creating apps in cross platforms like iOS, Android and Windows apps using Xamarin.

<strong>How</strong> !
<ol>
 	<li>Create a sample cross platform project</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2017/06/41.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/41-1024x704.png" alt="" class="alignnone wp-image-1215" width="541" height="372" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/5.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/5-1024x517.png" alt="" class="alignnone wp-image-1225" width="539" height="330" /></a>

Select a Blank forms App with shared project.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/6.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/6.png" alt="" class="alignnone wp-image-1227" width="244" height="197" /></a>

The Xaml file contains the design layout and you can just copy the code below or create your own XAML design.
<pre>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
 &lt;ContentPage xmlns="https://xamarin.com/schemas/2014/forms"
 xmlns:x="https://schemas.microsoft.com/winfx/2009/xaml"
 xmlns:local="clr-namespace:Sample_App"
 x:Class="Sample_App.MainPage"&gt;

&lt;StackLayout&gt;
 &lt;Slider VerticalOptions="CenterAndExpand"
 ValueChanged="OnSliderValueChanged" /&gt;

&lt;Label x:Name="valueLabel" Text="My First Sample Application" Font="Large" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" /&gt;

&lt;Button Text="Click Here"
 HorizontalOptions="Center"
 VerticalOptions="CenterAndExpand"
 Clicked="OnButtonClicked" /&gt;
 &lt;/StackLayout&gt;
 &lt;/ContentPage&gt;

</pre>
Now Tap on Live Player option near to your debug menu.
<a href="https://msdnshared.blob.core.windows.net/media/2017/06/31.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/31-1024x814.png" alt="" class="alignnone wp-image-1206" width="480" height="382" /></a>

Open Xamarin live player from your respective device like Android and iOS.

Scan your QR Code from the device and map it to the one shown in the visual studio screen above. Once done, the device will be mapped.

Deploy your code through Android and iOS and you can see it in the device as below.

&nbsp;

<strong>Android app running the sample app</strong>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/8.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/8-1024x65.png" alt="" class="alignnone wp-image-1236" width="803" height="51" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/Screenshot_20170604-201304.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/Screenshot_20170604-201304-576x1024.png" alt="" class="alignnone wp-image-1245" width="213" height="406" /></a>      <a href="https://msdnshared.blob.core.windows.net/media/2017/06/Screenshot_20170604-201312.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/Screenshot_20170604-201312-576x1024.png" alt="" class="alignnone wp-image-1255" width="216" height="384" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/Screenshot_20170604-203755.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/Screenshot_20170604-203755-576x1024.png" alt="" class="alignnone wp-image-1265" width="216" height="384" /></a>      <a href="https://msdnshared.blob.core.windows.net/media/2017/06/Screenshot_20170604-214323.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/Screenshot_20170604-214323-576x1024.png" alt="" class="alignnone wp-image-1275" width="218" height="388" /></a>

&nbsp;

<strong>iOS Device running the sample app</strong>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/7.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/7-1024x74.png" alt="" class="alignnone wp-image-1235" width="789" height="57" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/WhatsApp-Image-2017-06-04-at-11.06.00-PM1.jpeg"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/WhatsApp-Image-2017-06-04-at-11.06.00-PM1-576x1024.jpeg" alt="" class="alignnone wp-image-1285" width="216" height="422" /></a>               <a href="https://msdnshared.blob.core.windows.net/media/2017/06/WhatsApp-Image-2017-06-04-at-11.06.00-PM.jpeg"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/WhatsApp-Image-2017-06-04-at-11.06.00-PM-576x1024.jpeg" alt="" class="alignnone wp-image-1295" width="217" height="368" /></a>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/WhatsApp-Image-2017-06-04-at-11.06.01-PM.jpeg"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/WhatsApp-Image-2017-06-04-at-11.06.01-PM-576x1024.jpeg" alt="" class="alignnone wp-image-1305" width="238" height="503" /></a><a href="https://msdnshared.blob.core.windows.net/media/2017/06/WhatsApp-Image-2017-06-04-at-11.05.59-PM.jpeg">           <img src="https://msdnshared.blob.core.windows.net/media/2017/06/WhatsApp-Image-2017-06-04-at-11.05.59-PM-576x1024.jpeg" alt="" class="alignnone wp-image-1276" width="241" height="428" /></a>

&nbsp;

<strong>To be noted:</strong>

UI Test is not possible currently with the Xamarin Live app

The android or the iOS device should be connected to the network (wifi/LTE)

Some older projects might not be compatible. So better to create a new forms/native project and deploy it to test.

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Using Mind Maps instead of Test Cases !</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/using-mind-maps-instead-of-test-cases</link>
      <pubDate>Fri, 28 Apr 2017 02:38:40 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=1165</guid>
      <description><![CDATA[A Mind Map is a graphical representation of an idea/concept/process flow. User can use symbolic...]]></description>
      <content:encoded><![CDATA[<span class="a">A Mind Map is a graphical representation of an idea/<span class="w6"></span>concept/process flow. User can use symbolic representation to display the flow. In terms of testing, mind map can assist in covering the scenarios like equivalence/boundary valued etc.</span><span class="a"></span> Nowadays, most of the testing activities happen in a traditional way, understanding requirements -&gt; creating high level scenarios -&gt; segregation of test cases with different factors like functional and non-functional and then go on .. mind map will give a breakthrough approach on the traditional way.

<strong>Why Mind Map</strong>

- For large scale projects, creation of test cases is still a complicated process. Creation of test cases may look like a one time activity, yet the cost of maintenance is a huge effort ahead. Times taken for a person to go through all the individual test cases is a time consuming process.

- To avoid these kind of duplication and extraneous effort, we can prefer mind maps. These are effective tools to cover the functional matter to be tested.

- Mind Map creation is not a one time activity for agile projects, it takes a longer time to stabilize the mind maps. User has to carefully adjust the nodes in the map to reflect the exact change. On a coverage perspective, the mind maps look more easier to an end user.

- Once the mind map is created, the user can easily interlink the impacted areas and test the features accordingly. This is really helpful in large scale projects where there are multiple feature teams working together.

<strong>Creating a Mind Map</strong>

- For a developed application, User has to know the in depth details to create a mind map.

- For an agile application, the mind map will be evolving on day to day basis. There are many online/offline tools available.

<strong>How to Create</strong>

- Preferably, during the initial phase, the user is not supposed to use the tools directly as it would create more rework. Create a one using offline by using a whiteboard/paper so that any kind of changes will not have time or cost impact to introduce in the map. Once a checkpoint is reached where the user thinks the flow is complete, he can use the offline tool and create a draft version. <strong></strong>

- <a href="https://freemind.sourceforge.net/">Freemind </a>is one of the open source tool used to create mindmaps. There are other paid version apps like <a href="https://www.mindmup.com/">mindmup</a>, <a href="https://www.canva.com/graphs/mind-maps/">canva</a>, <a href="https://app.wisemapping.com/c/maps/3/try">Wisemapping</a>

Sample Mind Map created using <a href="https://app.wisemapping.com/c/maps/3/try">wisemapping </a>tool.

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/mindmap.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/04/mindmap-1024x440.png" alt="mindmap" class="alignnone wp-image-1175" height="401" width="934" /></a>

<strong>Impact on Test Life Cycle</strong>

- Assigning a tester to assert certain nodes in the mind map and validate. If there are interlinked maps, the tester can able to verify other components too.

- As the impacted areas can be covered easily, the user would be aware of what areas to be tested and what not.

- Test Reporting would be a complicated stuff. Yet would wish, if any tool can assist us in creating and managing the map for the test life cycle.]]></content:encoded>
    </item>
    <item>
      <title>Open Source tools to capture UI Elements - Web/Mobile Platform</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/open-source-tools-to-capture-ui-elements-webmobile-platform</link>
      <pubDate>Thu, 06 Apr 2017 03:21:20 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=1085</guid>
      <description><![CDATA[This content will help you to choose the appropriate tool for capturing UI elements for any...]]></description>
      <content:encoded><![CDATA[This content will help you to choose the appropriate tool for capturing UI elements for any automation.

<strong>Web Inspector</strong>

By default all the browsers have the developer tools integrated.

<strong>a. Built-in Browser tools</strong>

Pressing F12 in keyboard launches the developer tool. Here the user can point on any element -&gt; Right click and Click on 'Inspect Element' which launches a pane which highlights the property of the element.

<strong>IE Browser</strong>
<a href="https://msdnshared.blob.core.windows.net/media/2017/04/ie-dev-tools.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/04/ie-dev-tools-1024x481.png" alt="ie-dev-tools" width="830" height="390" class="alignnone wp-image-1115" /></a>

<strong>Chrome Browser</strong>

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/chrome-dev-tools.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/04/chrome-dev-tools-1024x515.png" alt="chrome-dev-tools" width="851" height="428" class="alignnone wp-image-1095" /></a>

<strong>Firefox Browser</strong>

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/firefox-dev-tools.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/04/firefox-dev-tools-1024x452.png" alt="firefox-dev-tools" width="842" height="372" class="alignnone wp-image-1105" /></a>

<strong>Plugins which comes handy !</strong>

<strong>d. Web Developer tool </strong>

It's a Chrome/Firefox plugin which can be installed from this location

For Firefox : <a href="https://addons.mozilla.org/en-US/firefox/addon/web-developer/">https://addons.mozilla.org/en-US/firefox/addon/web-developer/</a> .

Fore Chrome: <a href="https://chrome.google.com/webstore/detail/web-developer/bfbameneiokkgbdmiekhjnmfkcnldhhm">https://chrome.google.com/webstore/detail/web-developer/bfbameneiokkgbdmiekhjnmfkcnldhhm</a>

This includes all-in-one functionality of UI web dev. As displayed in the screen below, it has the ability to display all the parameters of an element.

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/firefoxweb.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/04/firefoxweb-1024x703.png" alt="firefoxweb" width="665" height="457" class="alignnone wp-image-1125" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/displayid.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/04/displayid-1024x494.png" alt="displayid" width="752" height="363" class="alignnone wp-image-1145" /></a>

&nbsp;

<strong>e. Xpath Helper </strong>

Generally for automation we use XPath for navigating to the elements from the root node.

For Chrome browser, Download the plugin from <a href="https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl">https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl</a>

Press 'Ctrl+Shift+X' to launch the Xpath Helper. Drag the mouse to any element by holding on the 'Shift' key. The below screenshot helps to identify the xpath of the element.

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/xpathhelpter.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/04/xpathhelpter-1024x316.png" alt="xpathhelpter" width="905" height="279" class="wp-image-1155 alignleft" /></a>

<strong>f. Css Viewer</strong>

Inspect Css using the below plugins

For Firefox download from <a href="https://addons.mozilla.org/en-US/firefox/addon/cssviewer/">https://addons.mozilla.org/en-US/firefox/addon/cssviewer/</a>

For Chrome, <a href="https://chrome.google.com/webstore/detail/cssviewer/ggfgijbpiheegefliciemofobhmofgce">https://chrome.google.com/webstore/detail/cssviewer/ggfgijbpiheegefliciemofobhmofgce</a>

Click on the CSSViewer and Scroll over an element to view its properties.

<a href="https://msdnshared.blob.core.windows.net/media/2017/04/Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/04/Untitled-1024x632.png" alt="untitled" width="1024" height="632" class="alignnone size-large wp-image-1156" /></a>

&nbsp;

<strong></strong>

<strong>Mobile Applications</strong>

&nbsp;

a. Install Android SDK. UIAutomationviewer comes along with SDK.

Open command prompt and navigate to Android SDK\tools. Launch uiautomatorviewer.bat file which will be displayed as below.

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2016/03/create21.png"><img class="alignnone wp-image-363" src="https://msdnshared.blob.core.windows.net/media/2016/03/create21.png" alt="create21" width="517" height="392" /></a>

Click on the Device Screenshot (second icon from left in the above screen)

Once captured, the screen is visible with the UI metadata. Click on number ‘7’. Once selected, the number ‘7’ is highlighted and get the ID value under the resource-id node.

<a href="https://msdnshared.blob.core.windows.net/media/2016/03/create22.png"><img class="alignnone wp-image-371" src="https://msdnshared.blob.core.windows.net/media/2016/03/create22.png" alt="create22" width="738" height="383" /></a>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Automate Universal Windows Platform (UWP) Application in Visual Studio using Appium</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/automate-universal-windows-platform-uwp-application-in-visual-studio-using-appium</link>
      <pubDate>Fri, 24 Mar 2017 08:49:57 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=1015</guid>
      <description><![CDATA[Universal Windows Platform, commonly knows as UWP. Microsoft provides a single app development...]]></description>
      <content:encoded><![CDATA[<h5><b>Universal Windows Platform</b>, commonly knows as UWP. Microsoft provides a single app development framework which can be</h5>
<h5>deployed to multiple devices which run on windows 10 devices like phone/surface/PC etc. In this topic we would go through the UWP</h5>
automation of the 'News App'(Desktop) using the Appium framework. Appium is a open source test automation tool for mobile apps.

The winappdriver uses the default selenium properties. Appium uses selenium API to automation the UI elements.
<h5><b>Tools to be used:</b></h5>
<h5>1. Visual Studio</h5>
<h5>2. Winappdriver - Download from <a href="https://github.com/Microsoft/WinAppDriver/releases">https://github.com/Microsoft/WinAppDriver/releases</a></h5>
<h5>3. Appium framework from Nuget manager</h5>
<h5><b>Procedure</b>:</h5>
<h5>1. Create a new unit test project.</h5>
<h5>2. Add the appium framework from nuget manager.</h5>
<h5>3. Install the UWP app(*.appx) in the device</h5>
<h5>4. Create test method to perform UI test.</h5>
<h5><strong></strong></h5>
<h5><strong>Steps:</strong></h5>
<h5>1. Creating a new unit test project in visual studio. Launch visual studio and goto file-&gt;new-&gt;project.</h5>
<h5>Select Windows-&gt;Test-&gt;Unit Test Project.</h5>
<a href="https://msdnshared.blob.core.windows.net/media/2017/03/unit-test.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/unit-test-1024x686.png" alt="unit-test" width="599" height="402" class="alignnone wp-image-1025" /></a>
<h5>Add references through nuget manager. Right Click on the solution and click on Manage Nuget Packages. Search for Appium and install it.</h5>
<a href="https://msdnshared.blob.core.windows.net/media/2017/03/nuget.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/nuget.png" alt="nuget" width="485" height="434" class="alignnone wp-image-1045" /></a>
<h5>After installation, all the references will be added to the project.</h5>
<a href="https://msdnshared.blob.core.windows.net/media/2017/03/references.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/references.png" alt="references" width="409" height="187" class="alignnone wp-image-1035" /></a>
<h5>Add the below code to the *.cs file. Compile and run the test using the test explorer. Ensure the winappdriver.exe is running</h5>
parallel'ly for execution. This is available @ C:\Program Files (x86)\Windows Application Driver

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/appium.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/appium-1024x441.png" alt="appium" width="559" height="241" class="alignnone wp-image-1055" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/tests.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/tests.png" alt="tests" width="339" height="211" class="alignnone wp-image-1056" /></a>
<pre>namespace News_Appium
 {
 [TestClass]
 public class NewsTest
 {
 protected const string WindowsApplicationDriverUrl = "https://127.0.0.1:4723";
 protected static WindowsDriver&lt;WindowsElement&gt; NewsApp;
 protected static WindowsDriver&lt;WindowsElement&gt; DesktopSession;

[ClassInitialize]
 public static void Setup(TestContext context)
 {
 DesiredCapabilities appCapabilities = new DesiredCapabilities();
 appCapabilities.SetCapability("app", "Microsoft.BingNews_8wekyb3d8bbwe!AppexNews");
 NewsApp = new WindowsDriver&lt;WindowsElement&gt;(new Uri(WindowsApplicationDriverUrl), appCapabilities);
 Assert.IsNotNull(NewsApp);
 DesiredCapabilities desktopCapabilities = new DesiredCapabilities();
 desktopCapabilities.SetCapability("app", "Root");
 DesktopSession = new WindowsDriver&lt;WindowsElement&gt;(new Uri(WindowsApplicationDriverUrl), desktopCapabilities);
 Assert.IsNotNull(DesktopSession);
 }

[ClassCleanup]
 public static void TearDown()
 {
 NewsApp.Quit();
 }

[TestMethod]
 public void TopNav()
 {
 NewsApp.FindElementByName("My News").Click();
 NewsApp.FindElementByName("My Sources").Click();
 string text = NewsApp.FindElementByName("Your News. Your Sources.").Text.ToString();
 Assert.AreEqual("Your News. Your Sources.", text);
 NewsApp.FindElementByName("Top Stories").Click();
 NewsApp.FindElementByName("US").Click();
 NewsApp.FindElementByName("World").Click();
 NewsApp.FindElementByName("Good News").Click();
 NewsApp.FindElementByName("Politics").Click();
 NewsApp.FindElementByName("Opinion").Click();
 NewsApp.FindElementByName("Crime").Click();
 NewsApp.FindElementByName("Technology").Click();
 NewsApp.FindElementByName("Entertainment").Click();
 NewsApp.FindElementByName("Money").Click();
 NewsApp.FindElementByName("Sports").Click();
 AppiumWebElement searchbox = NewsApp.FindElementByName("Search");
 searchbox.Clear();
 searchbox.SendKeys("Microsoft\r\n");
 string txtBlock = NewsApp.FindElementByClassName("TextBlock").Text;
 Assert.AreEqual(txtBlock, "Microsoft");
 }
 }
 }

<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif"><span>
</span></span>

</pre>
<h5>Compile the code and run the test using the test explorer The above code will use the News App Pre-installed in the windows 10</h5>
devices. Or you can use the store app(bing news) to install the app. ''Microsoft.BingNews_8wekyb3d8bbwe!AppexNews" is the app 

package name of the bing news app used in the above code.
<h5><b>Challenges</b>:</h5>
As the winappdriver is evolving, there would be suffice support from the open source community for any issues. Ex: for sending the text in

the textbox(key+enter), user as to use the escape sequence like \r\n. Like Textbox.sendkeys("Microsoft\r\n").

You can always check the updated versions in <a href="https://github.com/Microsoft/WinAppDriver"> https://github.com/Microsoft/WinAppDriver </a>]]></content:encoded>
    </item>
    <item>
      <title>White framework for automating WPF Application using Visual Studio</title>
      <link>https://docs.microsoft.com/archive/blogs/ganesh/white-framework-in-visual-studio-for-automation-of-wpf-application</link>
      <pubDate>Fri, 17 Mar 2017 02:40:18 GMT</pubDate>
      <dc:creator><![CDATA[Ganesh Alala Sundaram]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ganesh/?p=925</guid>
      <description><![CDATA[In this topic, we will discuss on using White Framework in Visual Studio for automating a wpf...]]></description>
      <content:encoded><![CDATA[In this topic, we will discuss on using White Framework in Visual Studio for automating a wpf application

To give an intro about white framework, this framework is .net based to automate win32/winform/wpf apps. Typically an object oriented API.

&nbsp;

<strong>Tools/App used</strong>
<ol>
 	<li><a href="https://github.com/TestStack/White">https://github.com/TestStack/White</a>. Solution name is WpfTestApplication</li>
 	<li>download Snoop 2.8.0 from <a href="https://snoopwpf.codeplex.com/">https://snoopwpf.codeplex.com/</a> this is used for spying objects in UI</li>
 	<li>Visual Studio</li>
 	<li>Nuget Package - TestStack.White</li>
</ol>
Open the solution in visual studio and compile it to get the WpfTestApplication.exe. The app looks like the below

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/sample1.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/sample1.png" alt="sample1" width="745" height="418" class="alignnone wp-image-926 " /></a>

<strong>Snoop Tool</strong>

When you access our WpfTestApplication.exe, you need to refresh it by clicking the button near the dropdown, and you see the mainwindow-wpftestapplication.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/snoop.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/snoop.png" alt="snoop" width="739" height="32" class="alignnone size-full wp-image-955" /></a>

<strong>Steps for creating the automation project in VS</strong>

Create a new project by navigating to File -&gt; New -&gt; Project. Select Tests - Unit Test Project.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/create-project.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/create-project-1024x520.png" alt="create-project" width="753" height="382" class="alignnone wp-image-935" /></a>

Add TestStack.white as reference by adding through manage nuget package.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/sample2.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/sample2.png" alt="sample2" width="732" height="155" class="alignnone wp-image-945" /></a>

Once you have installed the nuget package, you can see the below highlighted reference in the project.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/reference.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/reference.png" alt="reference" width="389" height="152" class="alignnone wp-image-975" /></a><a href="https://msdnshared.blob.core.windows.net/media/2017/03/sample2.png"></a>

&nbsp;

<strong>How to find the property of an element.</strong>

We have the WPF application in the left side and snoop tool on the right side. When you select a checkbox in the application, you can view the properties/events/data context/methods associated with the control in the snoop tool as described in the screenshot below.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/snoop1.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/snoop1-1024x311.png" alt="snoop1" width="1024" height="311" class="alignnone size-large wp-image-965" /></a>

<strong>Sample Code looks like the below.</strong>

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/samplecode.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/samplecode-1024x428.png" alt="samplecode" width="1024" height="428" class="alignnone size-large wp-image-976" /></a>

Once the testmethods are written, You can run the test in the test explorer. Right click on the method and click on 'Run Selected Tests'.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/testexplorer.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/testexplorer.png" alt="testexplorer" width="414" height="435" class="alignnone wp-image-985" /></a>

As like any of the UI automation frameworks, white framework allows us to select an element using few properties as below.

<a href="https://msdnshared.blob.core.windows.net/media/2017/03/properties.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/03/properties.png" alt="properties" width="333" height="244" class="alignnone size-full wp-image-986" /></a>

<strong>Few Listed Properties.</strong>

Launch the application.

<strong>Use White.Application.Launch(app_path)</strong>

Getting the context of the mainwindow.

<strong> Window mainWindow = application.GetWindow("MainWindow");</strong>

<strong>Clicking on a Button </strong>
<pre>TestStack.White.UIItems.Button btnbuttonintoolbar = mainWindow.Get&lt;White.UIItems.Button&gt;(SearchCriteria.ByText("Button in toolbar"));
btnbuttonintoolbar.Click();
</pre>
<strong>Clicking on a Tab</strong>
<pre>TestStack.White.UIItems.TabItems.TabPage tabInput = mainWindow.Get&lt;White.UIItems.TabItems.TabPage&gt;(SearchCriteria.ByText("Input Controls"));
tabInput.Click();</pre>
<strong>Get the list of items in a listbox and selecting the first item.</strong>
<pre>ListBox lnumber = mainWindow.Get&lt;ListBox&gt;("ListBoxWithVScrollBar");
lnumber.Select(0);</pre>
<strong>Get the list of items in a ComboBox and selecting the first item.</strong>
<pre>ComboBox cSelect = mainWindow.Get&lt;ComboBox&gt;("AComboBox");
cSelect.Select(0);</pre>
<strong>Clicking on a CheckBox</strong>
<pre>TestStack.White.UIItems.CheckBox chkSecond = mainWindow.Get&lt;White.UIItems.CheckBox&gt;(SearchCriteria.ByText("A checkbox"));
chkSecond.Click();</pre>
<strong>Inputting a text in a textbox.</strong>
<pre>TestStack.White.UIItems.TextBox txtBox = mainWindow.Get&lt;White.UIItems.TextBox&gt;(SearchCriteria.ByAutomationId("TextBox"));
txtBox.Text="Hi This is a Text Box";</pre>
<strong>Clicking on a radio button</strong>
<pre>TestStack.White.UIItems.RadioButton rdoBtn1 = mainWindow.Get&lt;White.UIItems.RadioButton&gt;(SearchCriteria.ByAutomationId("RadioButton1"));
rdoBtn1.Click();</pre>
<strong>Clicking on a hyper link</strong>
<pre>TestStack.White.UIItems.Hyperlink hlink = mainWindow.Get&lt;White.UIItems.Hyperlink&gt;(SearchCriteria.ByText("Link Text"));
hlink.Click();</pre>
<strong>Navigating through a slider</strong>
<pre>TestStack.White.UIItems.Slider sldrOne = mainWindow.Get&lt;White.UIItems.Slider&gt;(SearchCriteria.ByAutomationId("Slider"));
sldrOne.LargeIncrementButton.Click();
sldrOne.LargeDecrementButton.Click();</pre>
<strong>Expand a tree node</strong>
<pre>TestStack.White.UIItems.TreeItems.TreeNode nodeOne = mainWindow.Get&lt;White.UIItems.TreeItems.TreeNode&gt;(SearchCriteria.ByText("Root"));
nodeOne.Select();
nodeOne.Expand();</pre>
<pre></pre>]]></content:encoded>
    </item>
  </channel>
</rss>