Running Coded UI Tests (from action recordings with MTLM) in Team Builds (TFS2010)

January 21, 2010

With Visual Studio 2010 (Premium/Ultimate) we are able to create several types of automated tests. Automated tests will execute a sequence of test steps and determine whether the tests pass or fail according to expected results.

Coded UI Tests provide functional testing of the user interface and validation of user interface controls.

How to create Coded UI Tests? You could create them directly into Visual Studio, but for this blogpost I want to start from an action recording in Microsoft Test and Lab Manager (MTLM). An action recording is quite useful in manual tests that you need to run multiple times and for recycling common steps in different manual tests that contain shared steps.

I did create a simple test case with different test steps in MTLM to test some behavior on my website.

TestCaseDefinition

From MTLM I started a test run for this test case.

TestSuiteOverview

Before running the test, I do need to check the action recording to be sure to capture my actions for this test.

CreateActionRecording

The Test Runner will give a detailed overview of the recorded actions. Afterwards you will be able to replay all these stored actions in the Test Runner.

ActionRecordings 

After saving the results of this test run (all data is associated to my test case) it’s time to open Visual Studio 2010 and to create a Coded UI Test.

TestCaseAttachments

CodedUITestStart

Instead of choosing the default option to record actions I did choose to use an existing action recording after which I need to retrieve the appropriate test case to link to the associated actions.

ActionRecordingPicker

By clicking OK, Visual Studio will start generating code that will represent my actions that were recorded in Microsoft Test and Lab Manager. On top of that you are also able to add assertions on parts of the user interface in a separate Coded UI Test that you may reuse in other Coded UI Tests.

CodedUITestAssertions

Now, let’s integrate this entire UI test (MyCodedUITest) into the automated build. I created a default new build defintion where I also enabled to run the automated tests.

BuildDefinition

To run unit tests that interact with the desktop during a Team Build, we need to modify the Build Service Host properties in the Team Foundation Administration Console to run the build service as an interactive process instead of running the build service as a Windows Service.

BuildServiceHost

That’s about it. Make sure that the Build Service Host is running in the command line that will pop up after starting the BuildServiceHost. Queue the build and explore the results!

TestResults

Done!

With this post I wanted to highlight the powerful integration of (automated) testing into the upcoming Visual Studio 2010 offering.


New Training offering by Sparkles + Speaking at TechDays Belgium 2010

January 19, 2010

With my new company Sparkles I don’t only provide ALM consultancy services, but I also try to setup advanced training courses in Belgium with local and international experts.

An exclusive partnership with IDesign is set up to bring the best training to Belgium. IDesign’s training courses are among the world’s most intensive, most comprehensive .NET training classes given by the IDesign architects who have a world-renowned reputation as industry leaders. The IDesign architects are all frequent speakers at major international software development conferences, where they present their techniques, ideas, tools and breakthroughs.

In the week of March 1, 2010, Brian Noyes (Chief Architect at IDesign) will be in Belgium (Antwerp) for delivering an intensive 5 day training on Architecting WPF Applications.

On May 3-4, 2010, I will also deliver for the first time a detailed training on the new Application Lifecycle Management features of Visual Studio 2010. The Training class is called ALM with Visual Studio 2010.

This year Microsoft Techdays in Belgium are scheduled on March 30-31 + April 1 and I’m confirmed as a speaker. I will deliver a session on Branching and Merging with Team Foundation Server 2010.

In January I’m also starting to setup Team Foundation Server 2010 (Beta 2) at 2 new clients. More and more small development shops also see the benefits of a fully integrated development platform. Those companies that were still in doubt a few years ago are now convinced because of the promising upcoming release of Visual Studio 2010. The ALM train is on the rails! Very busy, but exciting times!


Application Lifecycle Management with VS2010

December 12, 2009

More than a week ago I did my first training (2 days) on Application Lifecycle Management with Visual Studio 2010. This was the agenda:

  • Introduction to Application Lifecycle Management with Visual Studio 2010
  • Advanced Version Control with Team Foundation Server 2010
  • Testing in Visual Studio 2010
  • Architecture in Visual Studio 2010
  • Applying Scrum with Team Foundation Server 2010

On December 22 I will deliver the Introduction part for a Queaso Get Together in Gent. Feel free to contact me if you want to schedule a session for your company / user group! Always fun to do!

The Introduction slides are also added to the download section.

I also make use of this post to show you the updated VS2010 Stadium Diagram, the new Big Picture (at this moment still without the Teamprise plugin).

So, no sign anymore of Team System editions, the introduction of the Test Elements SKU with Microsoft Test & Lab Manager (MTLM), some new features for TFS2010 (Requirements Management & Test Case Management) and the addition of Lab Management. Excellent offering!


ALM / TFS Books and Documentation

November 12, 2009

This week at TechEd in Berlin, Hans asked for some interesting ALM / TFS books. This is a quick random list of the latest books I know about:

Feel free to add some more books to the list!

Note that there is also a paperback version available of the TFS Guide: Team Development with Visual Studio Team Foundation Server, written by Microsoft Patterns & Practices. The online version can be found at CodePlex: TFS Guide.

If you are looking for the online MSDN documentation, point your favorite browser to the Team Foundation Server Developer Center.

There will also come some new books on VS2010: Professional Visual Studio 2010 Team System: with Team Foundation Server 2010, but I think that the name of the book will still change. Martin Woodward also mentioned that he’s writing on a new Team Build book for VS2010 and I’m sure that there are others under construction. To be continued!


TFS2010: Visualization of merging partial changes in changeset

November 11, 2009

Yesterday (during the Source Code Management session of Brian Harry at TechEd 2009 in Berlin), I noticed for the first time that merging partial changes in a changeset is also clearly visible afterwards. I just found some time between sessions to test it out …

In the screenshot above you may notice that changeset 9 (dev branch) is merged to the main branch. But look at the yellow color of the bar after the merge and the tooltip that is shown when I hover over changeset 11. Changeset 9 consisted of 2 different files that were modified while the merge operation took only 1 modified file in changeset 11. Valuable information!


Feedback VS2010 Beta2?

November 6, 2009

So, you are playing around with VS2010/TFS2010 and you have some remarks, suggestions, bugs, … Please go the Microsoft Connect site for product feedback and bug reporting.

Today I filed a suggestion for the next release of Team Foundation Server: Build Definition History. Unfortunately it’s still not possible to view history of changes made to the Build Defintion: “Drop Location”, “Build Agent”, “Trigger”, … On the Microsoft Connect site, you can easily look up other wanted featured and vote for them … but first vote for my suggestion!

Since a few weeks, there’s also a feedback survey running on Microsoft Visual Studio 2010 and the .NET Framework 4 Beta 2. If you care about the product and want your voice heard, please take some minutes to complete this online survey!


TechEd 2009 in Berlin

October 29, 2009

A few weeks ago I finally decided to sign up for TechEd 2009. This year, with the start of Sparkles I wasn’t planning to attend, but hey: some parties are not to be missed. After all, the VSTS sessions look very promising with top speakers and it’s a week I can spend to focus 100% on the VS2010 Beta 2 release I have installed on my laptop.

My scheduled VSTS agenda for TechEd 2009:

November 9

  • VSTS 2010: A Lap around the Developer and Tester Experience (Brian Harry)

November 10

  • VSTS 2010: A Lap around the New Project Management, Architecture, and Governance Capabilities (Brian Harry)
  • Source Code Management with TFS 2010 (Brian Harry)
  • An Agile Talk on Agility (Peter Provost)
  • Software Testing with VSTS 2010: Part 1, an Introduction (Brian Keller)

November 11

  • Software Testing with VSTS 2010: Part 2, Making It Real (Brian Keller)
  • Tools and Agile Teams (Stephen Forte)
  • Microsoft Visual Studio Team System 2010 Team Foundation Server: Become Productive in 30 Minutes (Brian Keller)
  • How Microsoft Does It: Internal Use of TFS and Microsoft VSTS for Software Development (Stephanie Cuthbertson)

November 12

  • Doing It Right: Planning and Tracking Projects with TFS 2010 (Stephanie Cuthbertson)
  • Successfully Administering and Running TFS 2008/2010 (Neno Loje)
  • Architecture Discovery and Validation with VSTS Architecture Tooling (Peter Provost)
  • You Are Still Using Microsoft Visual SourceSafe? (Neno Loje)

November 13

  • Microsoft Visual Studio Team System “Unplugged” (Stephanie Cuthbertson)

Out-of-the-box source server indexing with TFS2010

October 27, 2009

Wow! This is great! Tonight I just wanted to find out if and how it would work …

This is what I did with Beta 2 of Visual Studio 2010 Ultimate and TFS 2010 Basic on my Win7 laptop:

  • created a new Team Project
  • added a new solution with a C# Library Project to the Team Project
  • added a default Team Build to build the C# Library Project
  • added a new solution with a C# WPF Project to the Team Project
  • referenced the library assembly (file reference to dll) into the C# WPF Project and called a method on a class in that assembly
  • set a breakpoint on that line and hit F5 to start/debug the WPF application
  • pressed F11 (Step Into) when breakpoint was hit

Guess what?! Yes, Visual Studio 2010 was immediately stepping into the source file of the C# Library Project! Sweet!

I remember that it took me some time to get this working for TFS2008!

When you create a new Build Definition with TFS2010, the Index Sources option is set to true by default and this will make sure that source indexing is part of the build.

I took a peek into the DefaultTemplate.xaml file in the BuildProcessTemplates folder and found out that the Index Sources and Publish activity is indeed completely baked in! I love it already!



Visual Studio Team Foundation Server 2010 Beta 2

October 20, 2009

Since yesterday, MSDN subscribers are able to download Visual Studio 2010 Beta 2. I’m really excited about this release! Lots of important improvements in different areas of software development practices. I’m looking forward to further test and evaluate this release …

Today I did install already a Hyper-V image with a full blown Team Foundation Server 2010 Beta 2. Installation was absolutely flawless! First I installed IIS 7.0 and SQL Server 2008 on Windows Server 2008 R2. After that I was able to start the setup wizard of Team Foundation Server 2010 that’s now split into an installation part and a configuration part. The first part only copies the required files to the server while the second part takes care of the configuration. I did choose for the Standard Single Server wizard which guided me towards an easy and understandable configuration of the different TFS components. Thank you guys for keeping it simple! Other wizards are provided for more complex scenarios.

What I extremely like is the TFS Administration Console that pops up after closing the configuration wizard! It gives you a nice overview of what’s installed and you can control the project collections, build controllers, service accounts, … A lot of stuff that was managed via the command line in previous versions of Team Foundation Server. Good stuff! This Administration Console will probably evolve even more in the future.

You can start it now manually via Start > Programs (I do remember that with Beta 1 it was a snap-in for Microsoft Management Console).

So, that leaves me to install Visual Studio 2010 Ultimate Beta 2 for starting up a first development project. Note that Team Explorer is now part of the Visual Studio client edition and doesn’t need to be installed separately. Every Visual Studio edition will have a Team Explorer to connect to a Team Foundation Server. Very good!

You might have noticed that Team System did not come up once in this post up till now. I need to recover from the first shock, but the Team System moniker will eventually disappear. Back to the Visual Studio brand! I do not want to go deeper into this holy discussion but I assume there might be good reasons to take this drastic decision. In the end the decrease of different Visual Studio editions should make it more clear for all type of stakeholders. Agree or not … we will have to live with it! The decision has been made!

  • VS 2010 Professional
  • VS 2010 Premium
  • VS 2010 Ultimate

Read more about the different editions here. The Ultimate Edition will contain *everything*, including IntelliTrace (Historical Debugger) and the Test and Lab Manager which won’t be part of the Premium edition.

There’s also an interesting limited offer for existing MSDN subscribers.

Let’s have some fun! In the coming days I will also try out a TFS Basic installation on a Windows 7 OS …


Build Retention Policies in TFS2010

October 11, 2009

I noticed some interesting changes for the Build Retention Policies in TFS2010 (Beta 1):

  • possible differences between retention policy for triggered and manual builds vs private builds

    You will be able to set another retention policy on private builds: builds that are run by the enabled Gated Check-in trigger.

  • extra What to delete column

    You will be able to specify more in detail what information must be deleted when the retention policy kicks in.