How to extend Visual Studio 2010 Web- and Load-Testing with Transactional Tracing
Microsoft recently published the first official beta build of Visual Studio 2010. Visual Studio Team System for Testers has some nice improvements on their testing features. Additionally to new features – Microsoft also opened their extension points. One new interface that I am using to integrate dynaTrace into Visual Studio is the LoadTestPackageExt object and the ability to add new tabs to the WebTestResultViewer.
Providing your own tab in the Web Test Result Viewer
The image above shows a new dynaTrace tab that is added to the Result Viewer. Everytime the selection changes in the Result Tree – all tabs get a notification with the current selection context including the Web Reqest and Web Response. In my case I check the Web Response headers for the tagged dynaTrace Header. This header indicates that dynaTrace has captured a PurePath for the request. The header value also uniquely identifies the captured PurePath. My tab control hosts a Browser Control – displaying HTML that contains links all PurePaths of the currently selected request (there could be more than one PurePath because embedded requests may also result in a PurePath). With the new open dynaTrace RESTful APIs I can then just simply open the PurePath in the dynaTrace Client by sending an HTTP GET Request. (I will cover the RESTful Service APIs in a separate blog as I think this will be benefitial for many dynaTrace users).
Steps to implement your own custom tab?
Step 1: Create a Visual Studio Add-In
Just create a new Visual Studio Add-In Project. The Project Wizard will create a working Add-In.
Step 2: Reference Microsoft.VisualStudio.QualityTools. assemblies
Reference the following assemblies:
- Microsoft.VisualStudio.QualityTools. LoadTestPackage
- Microsoft.VisualStudio.QualityTools. LoadTestFramework
- Microsoft.VisualStudio.QualityTools. WebTestFramework
Step 3: Work with the LoadTestPackageExt object to register callbacks
In the OnConnection method of your Add-In you can register the callbacks in order to create and dispose your tab controls. In case your Add-In gets activated when a Result View is already opened – you can also iterate through the currently opened Result Windows.
Step 4: Create your tab control and add it to the Result Viewer
Implement a Create method that creates the new control and adds the control to the result viewer tab. Also – keep track of created controls and which test result is displayed. At the SelectionChange event handler you only want to update the control in the Test Result View that had the selection change. This is necessary because multiple result viewers can be open at the same time displaying different test run results.
Step 5: Implement your event handlers
The event handlers take care of triggering the tab creating, notifying about a selection change in a Result Viewer and notifying about the disposal of a result view.
Step 6: Update your control on selection change
Whenever the selection changes your event handler can forward the current context to your control.
Conclusion
Visual Studio provides more and more extension points that allow you to add your own tabs to the Result Viewer. dynaTrace leverages this new interface in addition to the interfaces that were support with older versions of Visual Studio, e.g.: LoadTest-Plugin, WebTest-Plugin and WebTestRequest-Plugin.
Related posts:
- Extending Visual Studio Unit Testing with Transactional Tracing In my previous blog entry I wrote about how to...
- Boston .NET User Group: Load and Performance Testing: How to do Transactional Root-Cause Analysis with Visual Studio Team System for Testers I am going to present at the next Boston .NET...
- Extending Visual Studio with Transactional Tracing Visual Studio is the number one development environment for Microsoft...
- Visual Studio Team System for Unit-, Web- and Load-Testing with dynaTrace Last week I was given the opportunity to meet the...
- Randomizing Input Data for Visual Studio Load Tests While preparing for my presentation Load and Performance Testing: How...




























How to extend Visual Studio 2010 Web- and Load-Testing with Transactional Tracing…
Thank you for submitting this cool story – Trackback from DotNetShoutout…
[...] the request, detailing how much time the request spent at each tier of your application. Check out Andreas’s post on the integration (including some code [...]
[...] the request, detailing how much time the request spent at each tier of your application. Check out Andreas’s post on the integration (including some code [...]
Architecture Blogs…
[...] Microsoft recently published the first official beta build of Visual Studio 2010. Visual Studio Team System for Testers has some nice improvements on their testing features. Additionally to new features – Microsoft also opened their … [...]…
Architecture Blogs…
[...] Ed Glas’s blog on VSTS load testing : dynaTrace Leverages new Extensibility Points to Provide Deep Integration with Dev10 @ 2009-05-20 19:25. [...] the request, detailing how much time the request spent at each tier of your application. … [……
[...] How to extend Visual Studio 2010 Web- and Load-Testing with … [...]