Trackyon CUIT Helpers

Trackyon LLC CUIT Helpers The Coded UI Test (CUIT) Helpers from Trackyon LLC allows IIS Express or Visual Studio Development Server (Cassini Web server) to be started by your test.  This prevents Coded UI Test from beginning without a server running. Features: Start and Stop IIS Express Start and Stop Visual Studio Development Server (Cassini Web server) Usage: To start using the package verify the app.config file of your test project contains either the webDevPath and/or the iisExpressPath values added to your appSettings section. These values are used by the library to start the respective web server.  If you installed the package using nuget the keys were added for you with paths assuming you are running .NET 4.0 and on a 64 bit machine.  If you are not running .NET 40 or not on a 64 bit machine you will need to adjust the paths. <add key="webDevPath" value="C:\Program Files (x86)\Common Files\microsoft shared\DevServer\11.0\WebDev.WebServer40" /> <add key="iisExpressPath" value="C:\Program Files (x86)\IIS Express\iisexpress" /> Starting Visual Studio Development Server (Cassini Web server) You can use the static Start method of the WebDev class in the Trackyon.CUIT.Helpers namespace.  The Start method takes two parameters port and path. Port is the port you want the web server to use to host your application.  Path is the path to the project to load.  The WebDev class provides a helper method FindProjectFolder that given the TestContext and Project Name will determine the path for you at runtime so the path is not hard coded.  Hard coding the path would require all developers to map the project to the same location on their machines.  The example below would start the MyWebApp project of the currently loaded solution on port 8081. WebDev.Start(8081, WebDev.FindProjectFolder(TestContext, "MyWebApp")); Once the test run is complete simply call Close to stop the server.  Starting IIS Express The IISExpress class also provides a static Start method, however, this method only takes a single parameter sitename.  The site name must map to a site already configured in your applicationhost.config file.  The site would be configured in the applicationhost.config file if you have setup your project to use IIS Express from the Web section of the project properties.  This file can be located in one of the two following locations: %userprofile%\documents\iisexpress\config\applicationhost.config %userprofile%\my documents\iisexpress\config\applicationhost.config The example below would start the MyWebApp site in IIS Express. IISExpress.Start("MyWebApp"); Once the test run is complete simply call Close to stop the server. Known Issues The icons for the servers may stay in Notification Area after the server has been closed.  Simply hovering your mouse over the icons will make them disappear. The servers will close after the test is complete regardless if you call close or not. They are created as child processes of the test assembly and when the test are unloaded the process is terminated.

KB2870699 breaks Coded UI Test

Problem: All my Coded UI Test start failing because they can't find the controls.  Solution: Uninstall KB2870699 - MS13-069: Cumulative security update for Internet Explorer: September 10, 2013. Explanation: After my machine applied several windows updates all my Coded UI Test that were working before the updates all began to fail. The test were unable to perform actions because the controls were hidden.  Each test would fail with the following exception: Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException You can read more about the issue here: Further Information After I uninstalled the update and rebooted my machine all my test began to run again.

How to set the “default” configuration for a project.

Being a Process Consultant specializing in TFS I teach many companies how to use Team Build.  When you create a new build definition you have the option to set “Configurations to Build”. However, if you leave that value blank the build will build the “default” configuration. The questions I am inevitability ask are “what is the default configuration” and “how do we set the default configuration”?  Well in this post I will show you where it is stored and how to update it for typical Visual Studio 2012 project. Visual Studio projects are msbuild scripts and because of that we can set properties in the actual project files that are going to be sent to msbuild to be compiled.  To change the default configuration you we need to load the project file as xml which is the file format of msbuild.  With the project open in Visual Studio simply right click on the desired project and select “Unload Project” from the context menu.  Once the project is unloaded right click on it again and select “Edit [Project Name]” and Visual Studio will open the file as an xml file we can edit.  Search the file for a “Configuration” element in a property group (it is normally the first group).  It should look similar to this: <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>   This is the line responsible for setting the default configuration of your build.  Simply change “Debug” to the desired default configuration, save the file then right click on project file in Solution Explorer and select “Reload Project”.  After you check in your changes an queue a new build it will be built using this configuration if the “Configurations to Build” is blank in the build definition.

I can't find the Kanban board in Update 2.

  Problem:  I installed Update 2 for TFS but when I click board I don’t see the Kanban board I see the task board.  Solution: Click the board link at the top of the Backlog Page under the "Product Backlog" heading next to "stories". Explanation: The board link at the top left of the page between the backlog and work items links takes you to the task board. But if you click the board link below the "Product Backlog" heading where you enter new User Stories it will take you to the Kanban board.

I can't access app.config from my web test plug in

Problem:  I want to read the connection strings from my app.config of my Web Test Project but it never loads.  Solution:  Use the Configuration Manager OpenMappedExeConfiguration call to load the app.config file.  Code:  // Map the new configuration file.ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap();configFileMap.ExeConfigFilename =   System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name + ".config"; // Get the mapped configuration filevar config = ConfigurationManager.OpenMappedExeConfiguration(   configFileMap, ConfigurationUserLevel.None); Explanation: The app.config of the test project is not loaded for web or load tests, because they are run in the same application domain as the test process (either vstesthost.exe or qtagent.exe), so they will load their config files instead. Therefore, we simply load the configuration file ourselves. Loading a configuration file is a two phased process.  First we build a ExcConfigurationFileMap object and set the name of our configuration file to be loaded. Then we open that file with a call to OpenMappedExeConfiguration method of the ConfigurationManager class. I am not a fan of hard coded values so we are going to get the name of the assembly using reflection and simply concatenate ".config" to the end of it.  Calling System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name will return the name of the assembly. After calling OpenMappedExeConfiguration you can use the returned object to access the connection strings or any other data from the app.config.

How to setup a discussion board on your TFS Project Portal

You can set up discussion boards on your SharePoint Project Portal site to share information and discuss topics with other people. Navigate to the Project Portal Click All Site Content at the bottom left of the page Click the Create link at the top of the page If you do not see the Create link you need at least the Design permission From the Communication section select Discussion Board Enter a Name and Description and click Create button

I get an error when I attempt to search my TFS Project Portal

Problem: When I attempt to use the search feature of my TFS Project Portal I get the following error: "Your search cannot be completed because this site is not assigned to an indexer. Contact your administrator for more information." Solution: Configure the "Microsoft SharePoint Foundation search server". Explanation: Open SharePoint 2010 Central Administration Click Manage content databases under the Application Management section Make sure the SharePoint site is selected for Web Application and not SharePoint Central Administration Click the WSS_Content database link Find the Search Server section and select a search server  If your dropdown is disabled you must for configure a search server

How to configure a search server for SharePoint 2010

If you would like to be able to search your TFS Project Portal you must enable a Microsoft SharePoint Foundation Search Service.  This process is for SharePoint 2010 that is installed by TFS during the configuration. Open a command prompt and change to the following directory: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN Run the following command: psconfig.exe -cmd services –install NOTE: This command will take down our TFS while it runs. Open SharePoint 2010 Central Administration Click Manage services on server under the System Settings section Click the Start link next to SharePoint Foundation Search You will be sent to the Configure Microsoft SharePoint Foundation Search Service Settings on server [serverName] Simply scroll down and click the Start button

Team Foundation Build Configuration - HTTP code 500

Problem:  After adding host headers to my TFS Website in IIS my build server fails to connect with the following error:   Solution: Add multipleSiteBindingsEnabled=true  to the serviceHostingEnvironment element in the C:\Program Files\Microsoft Team Foundation Server 11.0\Application Tier\Message Queue\web.config file on the application tier machine. Explanation: We added host headers to the TFS Website so users would not have to type in the port to reach web access.  After doing so our build would continue to fail.  Updating the web.config corrects the error and allows builds to run.