Custom Diagnostic Data Adapter capture the Webcam

Capture the webcam while testers execute a test case with Microsoft Test Manager… had this discussion today with a customer when talking about Diagnostic Data Adapter. Just for fun we decided that this would be a great adapter…   and just for fun I made one this evening…


Set the Diagnostic Data Adapter to capture images at the beginning and at the end of the test case. I didn’t captured the complete video, only images… would be interesting to make one also with indexing on test steps, to see how users act while executing a step, and make it picture in picture with the screen recording… anyway, it adds the two images as attachments.


I used this MSDN example:  Sample Project for Creating a Diagnostic Data Adapter 

and the libraries from this Codeplex project for the webcam capturing:

Just add the capturing logic to the methods ‘OnTestCaseStart’ and ‘OnTestCaseEnd’… and it starts capturing images… fun

public void OnTestCaseStart(object sender, TestCaseEventArgs e)
public void OnTestCaseEnd(object sender, TestCaseEndEventArgs e)

Comments (1) -

Goran Tesic 11/11/2010 8:49:36 AM

Hello Clemens,

What you wrote is exactly what I need. But, I can't make it work so far. Could you help me, please?

I wrote simple custom diagnostic data adapter that collects files. When I run the test localy inside VS2010 it works, which means I'm able to see the links to these files in "Collected Files" section in results window. As I can see SendFileAsync method is sending custom collected files to results.

But, I can't see these files attached when I use Microsoft Test Manager to run the tests. I suppose the same code should work in both cases.

When I run the test on remote computer from MTM with custom diagnostic data adapter, this error message appears:

Error 10.11.2010 11:47:32 The diagnostic data adapter 'LogsCollector.LogsCollector, LogsCollector, Version=, Culture=neutral, PublicKeyToken=null' on agent '0099FRSLABTS02' threw an exception during type loading, construction, or initialization: System.IO.FileNotFoundException: Could not load file or assembly 'LogsCollector, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'LogsCollector, Version=, Culture=neutral, PublicKeyToken=null'
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Microsoft.VisualStudio.TestTools.DataCollection.ExecutionPluginManager.LoadAndInitDataCollectorAsync(TestRun testRun, String collectorTypeName, Dictionary`2 dataCollectorCache)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
.  0099FRSLABTS02

Of course, I've copied custom diagnostic data adapter DLL on computer where MTM is, but it's VS2010 subfolder. It seems that DLL should be on remote computer where only Test Agent is as well. Where should I copy custom diagnostic data adapter DLL on remote computer where test runs?

This article describes the process:

Could you, please, explain how to attach custom log file to Microsoft Test Manager?

Thank you in advance.


Add comment