July 2010 - Posts
Windows Phone 7 – The First Fart Application
Yes I know, Farting isn’t nice… But each and every mobile phone on the planet has a Fart Application (Don’t ask me why!), So as a Fan of Phone 7 (In theory, still waiting to actually feel it…) I decide there is no way Microsoft Phone 7 will be without a decent Fart Application. (Fartless… :-))
So I built a simple Phone 7 Application called – Fart With 7 or Fart7 (Picture from the right) –>
Just download the zip file, extract it and run it from Visual Studio 2010, if this your first time using Phone 7 application please read Tomer Shamam post Programming Windows Phone 7 LOB Applications – Part I, there is a very good guide on what you need to install in order to Run Phone 7 Emulator on your machine.
If you want to built your own Phone 7 Application:
- Build Your First Windows Phone 7 Silverlight Application - Part 1
- Build Your First Windows Phone 7 Silverlight Application - Part 2
Download Fart 7 Application
Enjoy
TFS API Part 28 -Test Suite Hierarchy Builder
In my previous post regarding TFS API TFS API Part 27 – Test Plans, Test Suites, Test Cases Mapping, I showed how to create and obtain Test Plans, Test Suite and Test Cases objects.
As part of Quality Center to TFS 2010 Migration Tool I’m translating Quality Center hierarchy into Areas in TFS 2010 -
as you can see from the following pictures the QC hierarchy(middle picture) looks the same as TFS Areas (left picture) but it’s not feels the same…
Feels the same? when using QC you can navigate using the Tree View and drill down to the Test Suite (Folder) you want, to accomplish those actions in TFS you will have to write a Query and each time change the query values, Ammm… it’s not a good solution –
But using Microsoft Test Manager you can create Test Suites and Requirements with the same hierarchy as QC. (right picture)
In order to create those hierarchies quickly in TFS I built a tool just for that, this tool is using the following articles to complete this task.
The tool is very simple – Connect to TFS 2010, Create or Select Test Plan, Select Areas (One or more) and click start.
This action will take couple of minutes and in the end you will have full hierarchy in MTM based on the structure of the Areas in you project and the Test Cases assigned under each Area.
The result will be inside the Test Plan you picked before and all the Test Suite will be based on the Area Paths in the current Team Project.
Under each Test Suite you should see the related Test Cases.
Download Tool
Code Example:
Download Source Code
/// <summary>
/// Get's a full path of Area, split it and for each part create Test Suite and apply the Test Cases beneath it.
/// </summary>
/// <param name="full_area">Area Path, for example - CMMI\First Area\Sub Area\Content Area</param>
void CreateTestSuite(string full_area)
{
try
{
string[] areas = full_area.Split('\\');
string full_path = string.Empty;
IStaticTestSuite suite = null;
string current_area = string.Empty;
for (int i = 0; i < areas.Length; i++)
{
if (!string.IsNullOrEmpty(areas[i]))
{
string area = areas[i].RemoveBadChars();
current_area += area;
//The first item, find it and assigned to suite object.
if (i == 1)
{
ITestSuiteEntryCollection collection = _plan.RootSuite.Entries;
suite = TestHelper.FindSuite(collection, area);
if (suite.Id == 0)
{
suite.Title = area;
TestHelper.AddTests(suite, current_area);
_plan.RootSuite.Entries.Add(suite);
}
}
else
{
ITestSuiteEntryCollection collection = suite.Entries;
//* collection - Perform search only under the suite.Entries - Duplicate items allowed.
IStaticTestSuite subSuite = TestHelper.FindSuite(collection, area);
if (subSuite.Id == 0)
{//Cannot find Test Suite
subSuite.Title = area;
suite.Entries.Add(subSuite);
//After creating the Test Suite - Add the related TestCases based on the Area Path.
TestHelper.AddTests(subSuite, current_area);
}
suite = subSuite;
}
current_area += "\\";
_plan.Save();
}
}
_plan.Save();
}
catch (TestSuiteInvalidOperationException testex)
{
if (!testex.Message.Contains("Duplicate suite name detected"))
throw new ArgumentNullException(testex.Message);
}
}
TestSuiteHelper contains couple of simple actions like AddTests - that perform a Query in TFS to find all Test Cases under specific area path, also FindSuite as a recursive search under each suite (Recursive search because Suite doesn't have unique names so this should be individual search for each Suite).
public class TestSuiteHelper
{
private ITestManagementTeamProject _testproject;
private Project _project;
public TestSuiteHelper(
ITestManagementTeamProject TestManagementTeamProject,
Project project)
{
this._testproject = TestManagementTeamProject;
this._project = project;
}
public void AddTests(
IStaticTestSuite suite,
string area)
{
IEnumerable<
ITestCase> testcases = _testproject.TestCases.Query(
string.Format(
"Select * from [WorkItems] where [System.AreaPath] = \"{0}\\{1}\"", _project.Name, area));
foreach (
ITestCase testcase
in testcases)
{
suite.Entries.Add(testcase);
}
}
public IStaticTestSuite FindSuite(
ITestSuiteEntryCollection collection,
string title)
{
foreach (
ITestSuiteEntry entry
in collection)
{
IStaticTestSuite suite = entry.TestSuite
as IStaticTestSuite;
if (suite !=
null)
{
if (suite.Title == title)
return suite;
else if (suite.Entries.Count > 0)
FindSuite(suite.Entries, title);
}
}
return _testproject.TestSuites.CreateStatic();
}
}
Download Tool
Download Source Code
Test Scribe – Automatic Document Generating For Test Manager 2010
I got this question from lots of customers – How can I export Test Cases, Test Plans to a word document?
As you know Test Manager 2010 allows you to manage the entire Test Suite in one Tool, but for some customer installing Test Manager on every computer isn’t possible – For example – performing Tests on Linux…
One more reason is the ability to send the tests to the customer, so he can perform in house testing.
I’ve already saw couple of consultants building their own tools to complete this task – There is No Need to write it your self!!!
Test Scribe is a tool created by VSTS Quality Tools for generating documentation about TCM (Test Case Management) artifacts.
Testers can use a stand-alone client to connect to a TFS 2010 server/project.
With a Test Plan selected, users are able to generate a Test Plan Document, including information about the plan, the suite hierarchy, and each test case contained in the suites.
First Download Test Scribe and open Microsoft Test Manager, click on the main tab (Where “Testing Center”) and click on “Tools”.
Than you can choose what type of Document you want to generate:
- Test Plan Summary
- Test Run Summary
In my example I choose “Test Plan Summary” and to generate the Word Document just click - Generate
And the result is:

Scrat - Quality Center To TFS 2010 In Hours Instead Of Months
Regarding previous posts like Quality Center Migration To Team System 2010 – Done, Quality Center 2 TFS 2010 Migration In 3 Hours and more,
Today I’m happy to announce – Scrat is no more in Beta stages and has been tested successfully with various customers.
Scrat Includes:
- Wizard based tool
- Test hierarchy builder(Automatically build Test Plans, Test Suite and find matching Test Cases)
- Migrate Test Cases, Defect and Requirements
- Links between items (Tested By etc..)
- User Mapping
- Easy and simple Data Mapping
- Simulate States (See who moved the Item from one state to another)
- Based on Simple XML configuration file.
- And a lot more!
Are you using Quality Center? if so, this is your chance to perform smooth and quick migration to Microsoft Test Manager 2010, because not all migrations have to be painful.
Scrat Home Page

Greg Duncan –> A Feed You Should Read = Me
Friend just send me a link to a Greg Duncan post that he wrote on Me…
Read the Full Article
I’ve been following Shai’s blog for a few years (my first reblog of him looks like Feb 16 2009, Wit It! – One click Work Item access from TFS Alert Emails.) and his posts have become ones I look forward too.
The guy is a dev geek’s geek.
From playing with Bluetooth to Team System topics, MS Dev related announcements, with tons of cool coding posts as well. The posts are normally full, in-depth and filled with the sharing of his knowledge and experience (and code! :)
Oh yeah, and he’s doing it “just because”.
He’s a Microsoft MVP (i.e. not a MS employee) and so all his posts, content, code, etc are from the heart.
Like I said, a
Dev Geek’s Geek…
The First Reason I’m Blogging is no other that Guy Burstein who showed me the blogs(World) and gave me the right inspiration to start writing with enthusiasm and Fun – Again Thanks Guy!!!
The Second reason is the a great feeling when you know you’re not the only reader of your blog and the thing you write actually helps people!!! – Friends this worth Blogging!!!
Thanks a Lot Greg!!!!!! and everyone for your comments and feedbacks!
Read the Full Article
Coded UI Test – Tip 3 – Locate Controls Using Win + I
In my last post we talked about Coded UI Test – Tip 2 – Assertions, but there are much more things you can do using CodedUI Test Builder –today I’ll show one more cool tip that will help you recording CodedUI Test much more easily.
So today is how to locate control using Hot-Key, Why?
Two reasons:
- Easy
- It will allow you to locate inner control that are not available while dragging mouse.
For example: ComboBox Items – Let’s say I want to get the Bing object inside the Internet Explorer Context Menu.
If I’ll use the Assertion (Drag over the control) I’ll fail! because when drag the the Assertion sight the ComboBox (ContextMenu) will loss the focus and closed.
So, in order to complete this mission all you need to do is – Open the ComboBox place the mouse over the object you when to collect and press – WinKey + I

Enjoy.
Visual Studio Productivity Power Tools Updated
Microsoft just released an update for the very popular Visual Studio Productivity Power Tools.
Visual Studio Gallery
Brian Harry Post
Tools Options Support
The number one feature request by far has been the ability to turn off the individual extensions in the Productivity Power Tools. In this release, we’ve added an extension which adds a category to Tools Options which allows you to toggle the extensions on/off and provides a single place to find the options for a particular extension.

Solution Navigator (More Info)
Solution Navigator is a new tool window that acts like an enhanced Solution Explorer.

Twitter is over Capacity
Just tried to write some stuff regarding something I’m doing just so other people can think they know what I’m doing and than I got this lovely picture from Twitter:
Maybe it’s a sign… who thought that twitting can get so heavy…

TFS 2010 - TF30177 – Team Project Creation Failed
Today I tired to create new Team Project on TFS 2010 (Upgraded from 2008) and I got the following error:
The Project Creation Wizard encountered a problem while uploading documents to the following server running Sharepoint Products: server..,. The reason for the failure cannot be determined at this time. Because the operation failed, the wizard was not able to finish creating the team project.
I’ve checked for permissions and everything is Fine, I went to the TFS Administration Console to check if the SharePoint connection and saw there is a problem with the TswaWebPartCollection.wsp feature. (This works couple of days ago, so I don’t really know the real reason why that happed)
To deploy TswaWebPartCollection.wsp feature, open Sharepoint system administration go to “Operations” tab and click on “Solution Manager”.
Click on the “TswaWebPartCollection.wsp” and deploy the feature, ,now everything should work just fine.

Coded UI Test – Tip 2 – Assertions
Visual Studio 2010 comes with many new features not just to developers and architects also for the Testing World, and the one I’m going to show to day is Coded UI Test – A functional , UI testing based on .NET code. (How to Record Coded UI Test?)
As you know Coded UI Is Very powerful UI automation, but recording automation is not enough and you need to do some validation – to check if the actions you made result in the right way.
For validation in Coded UI Testing you need to use “Assertions”, asset is also used in Unit Test to verify the actual and expected result (and more).
To add assert to your Coded UI Test run the “Coded UI Test Builder” drag the viewfinder on top the control you want to perform the validation.
You will see Blue marker showing you the control you are catching, release the mouse button to get a list of all properties available for the specific control.
Choose the property you want to validate and Click “Add Assertion”.
If you having problem catching a control you can use the navigation dial control.
You can use the navigation dial to move around in the UI Tree
The following 4 operations are possible with the navigation dial.
- Navigate to the parent of the selected control.(Alt+Up)
- Navigate to the first child of the selected control. (Alt+Down)
- Navigate to the peer control to the left of the selected control. (Alt+Left)
- Navigate to the peer control to the right of the selected control. (Alt+Right)
Enjoy.
Running CodedUI Test From Another Application
As Coded UI Testing become a very powerful and easy UI Testing there is lots of questions regarding using it in various ways, for example : how can I run CodedUI Test from WinForm application???
So the answer is very easy:
Step 1
Create new WinForm application, and add reference to the below assemblies:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\
- Microsoft.VisualStudio.TestTools.UITesting.dll
- Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\
- Microsoft.VisualStudio.TestTools.UITest.CodeGeneration.dll
- Microsoft.VisualStudio.TestTools.UITest.Framework.dll
- Microsoft.VisualStudio.TestTools.UITest.Playback.dll
Make sure you change Winform target framework to full 4.0 and not 4 Client Profile.
Step 2
Add the code calling your test project and executing you Test method.
TestProject.CodedUITest1 coded = new TestProject.CodedUITest1();
coded.CodedUITestMethod1();
Here you will see your CodedUI throws an error - Object reference not set to an instance of an object.
This is because you must run: Playback.Initialize(); before you starting your Test.
So the code should look like that:
Playback.Initialize();
TestProject.CodedUITest1 coded = new TestProject.CodedUITest1();
coded.CodedUITestMethod1();
Playback.Cleanup();
And you’re Done!!!
Enjoy.
Administrative Report Pack for Team Foundation Server 2010
Couple of days ago Grant Holliday's post about new Reports pack for TFS admins to answer the following question:
- How long is cube processing taking?
- How much time elapses between processing jobs?
- How often do the processing jobs run?
- Do errors occur with when the cube is processed?
Process Times:

Current Processing Status
This table tells you whether the warehouse is currently being processed or when it will be processed next.

The Next Run Time is in local time, and Run time is the duration of the job that is currently running.
Warehouse Job Status
This table lists all team project collections and all Data Adapter Jobs and displays how long ago the Warehouse and Cube data were updated. In addition, the table will show the schema conflicts and other Data Adapter errors that caused data to be out of date:

Requirements
- SQL Server Reporting Services 2008 or 2008 R2
- A shared datasource to which you connect the report, as the installation instructions describe how to configure.
Enjoy
Building Setup Project In devenv.com Command Line Fails, Works In IDE
I started to build a Build Definition in TFS 2010 (WF) for one of my customers and ran into a strange problem with couple of Setup Projects, when I build the Setup Project in Visual Studio 2010 IDE the setup built just fine but once I tried to build it using devenv command it fails.. (To build setup project using Team Build you need to invoke devenv with command line arguments.)
The Error from the command line is:
ERROR: Unable to update the dependencies of the project. The dependencies for the object ‘DLL NAME’ cannot be determined.
This was very strange, so I did a comprehensive investigation why this happens and I found the problem!
For some reason when adding a File to the setup project that need Dependencies, Visual Studio automatically add them into the Dependencies folder in the Setup project and for some reason this dependency cannot be found from Command Line.
Here is a Simple Setup Project in Visual Studio
Through Command Line - Working
The same Setup Project + I’ve added an Assembly “API.DLL” and Visual Studio automatically added the necessary Dll’s.
This setup project build just fine in Visual Studio.
Through Command Line – Not Working!
The Solution: You need to add the missing Assembly in the same folder where the .vdproj file is.
Before I’m using WorkFlow to build those Setup Projects I built a special Activity that find the needed Dependencies of each setup project copy them into the folder and the Build the Setup project.
Than Through Command Line – Working Again!!!
Hope this helps.
TFS 2010 Support for Project Server
Brian Harry just post the Microsoft released a CTP demonstrating integration between Team Foundation Server 2010 and Project Server 2010 (the final product will also support Project Server 2007 but the CTP is 2010 only).
You can download the CTP here: http://go.microsoft.com/fwlink/?LinkID=196413
This CTP is provided as a Virtual Machine and is not intended to be used in a production environment
Enjoy
TFS API Part 27 – Test Plans, Test Suites, Test Cases Mapping
In my last post TFS API Part 26 – Add/Remove Test Plans I showed how to Add remove Test Plan using MTM API.
Picture - A
Now when we know how to use work with Test Plan lets deep dive to all items under each Test Plan, in this post I’ll show how to get all Test Suites hierarchy Test Cases and more.
As QA manager it will be awesome to get a view of all Team Project and all Test Plans under one window.
Download Demo Project
Step 1: Create Project and Add Reference
Create an WPF/WinForm application and add the following references:
- Microsoft.TeamFoundation.WorkItemTracking.Client.dll
- Microsoft.TeamFoundation.Client.dll
- Microsoft.TeamFoundation.dll
- Microsoft.TeamFoundation.TestManagement.Client
All files located under - c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\
Step 2: Connect to Team Foundation Server
private TfsTeamProjectCollection _tfs;
private ITestManagementTeamProject _testproject;
TeamProjectPicker tpp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
tpp.ShowDialog();
if (tpp.SelectedTeamProjectCollection != null)
{
this._tfs = tpp.SelectedTeamProjectCollection;
ITestManagementService test_service = (ITestManagementService)_tfs.GetService(typeof(ITestManagementService));
this._testproject = test_service.GetTeamProject(tpp.SelectedProjects[0].Name);
GetTestPlans();
btn_add.IsEnabled = true;
btn_remove_plan.IsEnabled = true;
}
Step 3: Get Test Plans
void GetTestPlans(ITestManagementTeamProject testproject)
{
ITestPlanCollection plans = testproject.TestPlans.Query("Select * From TestPlan");
TreeViewItem root = null;
root = new TreeViewItem();
root.Header = ImageHelpers.CreateHeader(testproject.WitProject.Name, ItemTypes.TeamProject);
TreeMain.Items.Add(root);
foreach (ITestPlan plan in plans)
{
TreeViewItem plan_tree = new TreeViewItem();
plan_tree.Header = ImageHelpers.CreateHeader(plan.Name, ItemTypes.TestPlan);
if (plan.RootSuite != null && plan.RootSuite.Entries.Count > 0)
GetPlanSuites(plan.RootSuite.Entries, plan_tree);
root.Items.Add(plan_tree);
}
}
Step 4:Get Test Suites
void GetPlanSuites(ITestSuiteEntryCollection suites, TreeViewItem tree_item)
{
foreach (ITestSuiteEntry suite_entry in suites)
{
IStaticTestSuite suite = suite_entry.TestSuite as IStaticTestSuite;
if (suite != null)
{
TreeViewItem suite_tree = new TreeViewItem();
suite_tree.Header = ImageHelpers.CreateHeader(suite.Title, ItemTypes.TestSuite);
GetTestCases(suite, suite_tree);
tree_item.Items.Add(suite_tree);
if (suite.Entries.Count > 0)
GetPlanSuites(suite.Entries, suite_tree);
}
}
}
Step 5: Get Test Cases
void GetTestCases(IStaticTestSuite suite, TreeViewItem tree_item)
{
//AllTestCases - Will show all the Test Cases under that Suite even in sub suites.
//ITestCaseCollection testcases = suite.AllTestCases; – See Picture B
//Will bring only the Test Case under a specific Test Suite. – See Picture A
ITestSuiteEntryCollection suiteentrys = suite.TestCases;
foreach (ITestSuiteEntry testcase in suiteentrys)
{
TreeViewItem test = new TreeViewItem();
test.Header = ImageHelpers.CreateHeader(testcase.Title, ItemTypes.TestCase);
tree_item.Items.Add(test);
}
}
Picture - B

Download Demo Project
More Posts
Next page »