<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Anuj Chaudhary</title><subtitle type="html">Software Testing and Automation</subtitle><id>http://blogs.msdn.com/b/anujchaudhary/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/anujchaudhary/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/anujchaudhary/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2012-11-02T22:43:00Z</updated><entry><title>Windows Azure: Automated UI testing using the power of cloud</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/anujchaudhary/archive/2012/11/02/windows-azure-automated-ui-testing-using-the-power-of-cloud.aspx" /><id>http://blogs.msdn.com/b/anujchaudhary/archive/2012/11/02/windows-azure-automated-ui-testing-using-the-power-of-cloud.aspx</id><published>2012-11-02T22:43:00Z</published><updated>2012-11-02T22:43:00Z</updated><content type="html">&lt;div&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-family: Cambria;"&gt;Problem Statement&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Automated UI testing needs to be performed from different parts of the world.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;The tests can validate various UI behaviors from different geo locations e.g. behavior of JavaScript which makes service calls.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-family: Cambria;"&gt;Background&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;As we have seen in my previous post on &lt;em&gt;&lt;a href="http://social.technet.microsoft.com/wiki/contents/articles/6073.windows-azure-performance-testing-using-the-power-of-cloud.aspx"&gt;&lt;span style="color: #0000ff;"&gt;Performance testing using the power of cloud&lt;/span&gt;&lt;/a&gt;&lt;/em&gt;, it is possible to install test agents around the globe and run Load Tests from the agents. The same setup can be used to run unit tests or web tests by distributing them across different agents.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000; text-decoration: underline;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-family: Cambria;"&gt;Challenge&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;The challenging part is to run UI tests (e.g. Coded UI) from the agents in cloud. This is because we will always need to have an active desktop session for the tests to interact with the UI. One option would be to have dedicated&amp;nbsp;hardware on premise from where active remote desktop session is always maintained for all the agents in the cloud. The other option is to tweak the configuration a little as described below without requiring any additional hardware.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #000000; text-decoration: underline;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-family: Cambria;"&gt;Solution&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: small;"&gt;Perform the same steps which were done for the setting up the environment to run load tests i.e. Installing Test Controller on Premise and Setting up Windows Azure Connect.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: small;"&gt;Now below are the changes that the needed to specifically run Automated UI Tests&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: small;"&gt;Instead of having just one user on the Azure VM&amp;rsquo;s, we will need to have two users. One of them is used for Remote Desktop and the other one is used to Run Tests.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;The Remote Desktop user needs to be specified in the configuration file (.cscfg)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;&amp;lt;&lt;/em&gt;&lt;em&gt;Setting&lt;/em&gt;&lt;em&gt; &lt;/em&gt;&lt;em&gt;name&lt;/em&gt;&lt;em&gt;=&lt;/em&gt;&lt;em&gt;"Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="remoteuser" /&amp;gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;The Test Agent user needs to be created in setup.cmd (This user name and password should be the same as the one configured on Test Controller)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REM Create user vstestagent as an administrator&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;net user vstestagent &amp;lt;&amp;lt;password&amp;gt;&amp;gt; /expires:never /add&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;net localgroup administrators vstestagent /Add&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Deploy the worker role and add it to the Local Endpoint Group for Windows Azure Connect as before.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Now Remote Desktop to the Azure VM from the Azure Portal using the Remote Desktop user.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Once connected, get the machine name of the VM from Computer-&amp;gt;Properties.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Go to Run and type mstsc and connect to the same VM using the machine name. While connecting this time, type the credentials of the Test Agent user.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Configure the test agent with the test controller in Interactive mode.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-48/1832.1.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-48/1832.1.png" alt="" width="300" height="318" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-48/5224.2.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-48/5224.2.png" alt="" width="448" height="316" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Finally, a script needs to be run to turn off IE ESC, set default IE settings, turn off Phishing filter and disable Auto Lock. A command file can be added which does the following:&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REM Configure IE ESC to Off&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" /v "IsInstalled" /t REG_DWORD /d 0 /f&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" /v "IsInstalled" /t REG_DWORD /d 0 /f&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;Rundll32 iesetup.dll, IEHardenLMSettings&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;Rundll32 iesetup.dll, IEHardenUser&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;Rundll32 iesetup.dll, IEHardenAdmin&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" /f /va&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" /f /va&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REM Set Default IE Settings&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "First Home Page" /f&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Default_Page_URL" /t REG_SZ /d "about:blank" /f&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d "about:blank" /f&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REM Disable Phishing Filter&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PhishingFilter" /v "ShownVerifyBalloon" /t REG_DWORD /d 3 /f&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PhishingFilter" /v "Enabled" /t REG_DWORD /d 0 /f &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REM Disable Auto Lock&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;&lt;span style="color: #993300; font-size: x-small;"&gt;&lt;em&gt;REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "DisableLockWorkstation" /t REG_DWORD /d 1 /f&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Now don&amp;rsquo;t minimize any remote desktop windows and simply close the remote desktop window of the Remote Desktop user. This way the Remote Desktop window of the Test Agent user will be always active and the UI Tests can interact with the desktop.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-family: Cambria;"&gt;Result&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Now you can run your tests using the Test Controller. The Agent running as an interactive Process should be shown with an asterisk (*)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-48/5734.3.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-48/5734.3.png" alt="" width="365" height="352" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;The Automated UI Test runs on the Test Agent&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-48/5861.4.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-48/5861.4.png" alt="" width="504" height="128" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;To confirm that the desktop doesn&amp;rsquo;t get locked, wait for 10-15 minutes, rerun the automated UI test and verify that it passes.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10365419" width="1" height="1"&gt;</content><author><name>AnujChaudhary</name><uri>http://blogs.msdn.com/anujqa_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="coded ui" scheme="http://blogs.msdn.com/b/anujchaudhary/archive/tags/coded+ui/" /><category term="test agent" scheme="http://blogs.msdn.com/b/anujchaudhary/archive/tags/test+agent/" /><category term="testing" scheme="http://blogs.msdn.com/b/anujchaudhary/archive/tags/testing/" /><category term="windows azure" scheme="http://blogs.msdn.com/b/anujchaudhary/archive/tags/windows+azure/" /><category term="test controller" scheme="http://blogs.msdn.com/b/anujchaudhary/archive/tags/test+controller/" /><category term="ui automation" scheme="http://blogs.msdn.com/b/anujchaudhary/archive/tags/ui+automation/" /></entry></feed>