WPF Global Exception Handler

Tuesday, December 9, 2014

I decide to write this post because I’m facing too many applications that crash, yes just crash – no massage or recovery just crash!!! For some application it feels like 50% chance to get an exception, for me when an application crashes frequently I stop using it when I can find a proper replacement, but not always I can find suitable a replacement. In case you don’t know what I’m talking about here is a small application I’ve created to demonstrate what I’m talking about. Now, it doesn’t required a lot of work to handle those unhandled...

How To: Enable Coded UI Html Logger

Monday, November 24, 2014

Many of my customers has already build large amount of Tests based on Coded UI, those tests running every build and every day, for a second everything looks just perfect, until a test failed with unexpected exception…. Then we need to understand why? the test failed because the new build broke the test? maybe something wrong with the test? So the obvious choice is adding logs to Coded UI, Coded UI has some basic logs capabilities, you can use either console, trace and TestContext to write logs inside your Coded UI Tests. Console.WriteLine("Console Writeline"); Trace.WriteLine("Trace Writeline"); TestContext.WriteLine("TestContext Writeline"); Now, if you...

Windows Azure Storage Emulator – v3.0 – Installation failed

Tuesday, July 1, 2014

Today I faced a very annoying and strange issue while installing newer version of Azure Storage Emulator on my machine. Tried to remove almost everything related to Azure but still nothing worked…. Although I ran DsInit to work on SQLEXPRESS instead of localdb I decide to delete sql local db by running the following commands: sqllocaldb stop v11.0 sqllocaldb delete v11.0 sqllocaldb create v11.0” The result should be - “LocalDB instance "v11.0" created with version 11.0.” After recreating SQL local db Azure Storage Emnulator worked. Hope this helped.

How To: Run Tests On Different Machines In Parallel

Wednesday, June 18, 2014

I’m getting this question a lot, how to run multiple tests on different machines in parallel? Every customer that I work with has over 100 tests and some has more than 1000+. So how to improve test execution time? running 1000+ tests can take a while and we want to get the results as fast as possible. So, for Unit Tests there is a nice trick (Wrote about it in 2010 –>Run Unit Tests in Parallel using Visual Studio 2010) that allow you to run those tests in parallel on the same machine. But what about Coded UI Tests? you most know we...

TFS API Part 52 – Getting Work Item History

Wednesday, October 30, 2013

Tweet Work Item History field isn’t just a Text field that shows all the changes in a specific work items, it’s a collection of Revision object. Each time you save a Work Item a new revision object is been create and represent the Work Item Latest values. You can use the History to get previous values from Fields, Links and Attachments history. In this post I’ll show how to get Work Item revision list and display the Fields of specific revision. Download Demo Project Step 1: Connecting To TFS And Getting Work Item Store private void btnConnect_Click(object sender, RoutedEventArgs e) { TeamProjectPicker tpp...

TFS API Part 51 – Adding Test Step & Shared Step

Monday, October 7, 2013

Working TFS API for Test Cases is different from Work Items, the usage is different and this cause many of customer to send me questions regarding Test Case API. This post will demonstrate how to create new Test Case, Adding Steps, Step Attachments, Shared Steps and more. As always we need to start with connecting TFS Object Model: TeamProjectPicker tpp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false); if (tpp.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; TfsTeamProjectCollection Tfs = tpp.SelectedTeamProjectCollection; For Work Items we need to obtain WorkItemStore object, but for Test Cases we need to work with ITestManagmentTeamProject object. ITestManagementServiceservice = (ITestManagementService)Tfs.GetService(typeof(ITestManagementService)); ITestManagementTeamProject TestProject = (ITestManagementTeamProject)service.GetTeamProject(tpp.SelectedProjects.Name); The ITestManagmentTeamProject contains many helpers for Test API TestPlans...

WPF WebBrowser – getElementsByClassName Isn’t Working

Wednesday, October 2, 2013

Working on a WPF app for a customer we’ve faced a strange problem, our WPF app display some HTML content and allow user actions on the Web Browser control – Expend and Collapsed div elements. Because the JavaScript code is simple I don’t want to add any external library to our generated HTML and JavaScript code. Here is how the Expend and Collapse code looks like: function toggleAllItems(show) { var text = '+'; var style = 'none'; if (show) { ...

Visual Studio 2012 – No exports were found that match the constraint contract name

Sunday, September 29, 2013

For some unknown reason once I opened Visual Studio 2012 I’ve received the below error, everything worked just fined couple of days ago. I’ve tried Visual Studio command line execution tricks but nothing, then I tried to delete the client cache and that solved the problem. Remove ComponentModelCache folder content. %AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache

Could not load file or assembly ‘Microsoft.TeamFoundation.Client While Running Tests

Thursday, July 25, 2013

I know this sounds strange – What the relation between “'Microsoft.TeamFoundation.Client” and Running Tests from command line? Visiting a customer I saw this error when the the customer tried to run Coded UI Tests using MsTest (Machine only with Test Agent): Run has the following issue(s): Failed to queue test run 'XX@XXX-XXXTEAM-PC 2013-07-18 17:58:02': Could not load file or assembly 'Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=ne utral, PublicKeyToken=b03f5f7f11d50a3a' or one of its...

TFS API Part 50 – Get Team Project Template

Sunday, July 21, 2013

In my last post TFS 2012 Upgrade Process Template–Guide I’ve talked about upgrading an existing Team Project Template to another or a newer template. An important part of the upgrading process is knowing from what template you are upgrading from – although this is not really important because the base template can be modified completely. So here is a simple tool to display the Base Process Template name. Download Demo Project Step 1: Connect TFS and Getting Team Projects Create WPF Application, and add the basic code for connecting...