Inside TFS

Visual Studio 2010 Feature Pack 2

Microsoft's cumulative Feature Pack update for MSDN subscribers adds useful new testing capabilities to Visual Studio 2010.

Microsoft has always been good about releasing out of band features for Visual Studio and Team Foundation Server. These features were originally referred to as Power Toys, and then changed to Power Tools. These new pieces of functionality were used to address gaps in the product, and were made available to the general public.

While the Power Tools still exist, starting with Visual Studio/Team Foundation Server 2010, Microsoft decided they also needed to fill the gap between the Power Tools and their "real products." Essentially, they were looking for a way to release new features that are part of the product, without having to wait for the next release cycle. So they developed the concept of a Feature Pack, which extends Visual Studio 2010 with capabilities, as well as enhances and compliments existing tools in the product. One key difference between Feature Packs and Power Tools is that Feature Packs are only available to MSDN subscribers, adding even more value to an MSDN subscription.

The Visual Studio 2010 Feature Pack 2 is now available for MSDN Subscribers. This new feature pack delivers a number of new features aimed directly at the testing area of Visual Studio 2010. The Visual Studio 2010 Feature Pack 2 is a cumulative feature pack, so in addition to the new testing features, it also contains all the previous enhancements from Feature Pack 1.

Testing Silverlight 4 Applications
Feature Pack 2 allows for Silverlight 4 application testing. Both Coded UI Tests and manual tests with action recordings are now possible. This allows you to gather bug data, including environment information, about the application in question. Unfortunately at this time IntelliTrace logs are not supported for Silverlight 4 applications.

To use this feature, you must add the Microsoft.VisualStudio.TestTools.UITest.Extendsion.SilverlightUIAutomationHelper.dll as a reference in your Silverlight 4 application. This DLL allows Silverlight controls to be identified, and helps instrument Silverlight applications to make control information available to the Coded UI Test or action recording. One limitation to be aware of is that the Silverlight test support only works for Silverlight 4.0 applications being hosted in Internet Explorer. Out of browser Silverlight 4 applications cannot be tested in this fashion at this time.

Playing Back Tests Using Mozilla Firefox
Feature Pack 2 enables you to record actions in a Web-based application using Internet Explorer and then play those tests back using the Mozilla Firefox browser. This allows you to create a set of tests one time and use it for regression testing across both platforms, making it easier to ensure the application works on multiple browsers.

To enable this functionality once you have installed Feature Pack 2, you need to install and configure the Test Helper Extension for Mozilla Firefox. This is a separate executable that is installed by the feature pack that needs to be run. It is also worth noting that we are only using the Firefox browser to play back the tests. Recording tests for Web-based applications using the Firefox browser is not supported.

Coded UI Test Editor
Finally, the Coded UI Test Editor is a new editor that allows you to easily modify coded UI tests. (For more information on Coded UI Tests, please see Part 1of our four-part series of columns on the topic.) By using this editor, you can easily find, view and edit test methods, UI actions and controls in the UI control map.

To open the editor, right-click on the UIMap.uitest of the coded UI test, and select Open from the context menu. The UIMap.uitest file will open as a tab in Visual Studio, displaying its information in the Coded UI Test Editor.


[Click on image for larger view.]
Figure 1.

The left pane contains the list of actions that were recorded in the test. You can select an action and edit its properties in the Property window. The right pane contains a list of all the controls that were used. You can select a control and edit its properties in the Property window as well.

The editor contains the following functionality in its toolbar:

  • Find – locate UI actions and controls
  • Delete – remove UI actions
  • Rename – change test method and control names
  • Split – splits into a new method
  • Move Code – Add custom code to a test method
  • Insert Delay Before – inserts a pause (in milliseconds) before a selected UI action
  • Locate UI Control – Finds the location of a control in the UI of the application being tested
  • Locate All – helps verify control properties and application control changes

As mentioned at the beginning of this column, Feature Pack 2 is cumulative, meaning it also contains all the enhancements from Feature Pack 1, including:

  • C++ Modeling Tool Support
  • Modeling Tool Web Site Support
  • UML Class Diagram Code Generation
  • Layer Diagram Validation Extensibility
  • XMI Import

There are specific instructions for installing Feature Pack 2 if you already have Feature Pack 1 installed, so make sure to read the appropriate section on the download page.

Visual Studio 2010 Feature Packs add tremendous value to Visual Studio 2010, and the addition of the testing functionality in Feature Pack 2 make it a must-have for your tool arsenal.

About the Author

Mickey Gousset spends his days as a principal consultant for Infront Consulting Group. Gousset is lead author of "Professional Application Lifecycle Management with Visual Studio 2012" (Wrox, 2012) and frequents the speaker circuit singing the praises of ALM and DevOps. He also blogs at ALM Rocks!. Gousset is one of the original Team System/ALM MVPs and has held the award since 2005.

comments powered by Disqus

Featured

Subscribe on YouTube