SeeTestAutomation- Connecting Reports To The Test Case Result
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
The MTM Collector for SeeTestAutomation
In the following section we will demonstrate how to connect the SeeTestAutomation HTML report to the MTM test run result. To do so we will build a new project in Visual Studio and create two files:
- .dll file
- .pdb file
We will take those two files and place them on the host machine. then we will navigate to the MTM "Lab Center"-> "Test Setting" we will see a new option there to enable the Collector we assembled. The test result after enabling the Collector will contain a .trx file that will link us to a zipped folder containing the report and the screenshots associated with it.
There are two major services related to the process and they should run on the host machine (the TFS-Server in our configuration) called "VSTTContrller" and "VSTTAgent". When trying to configure the "Collector" you may need to stop and restart them so changes could be performed on the .dll and .pdb files.
Step 1: The Collector code
a. Create a DataCollector project on Visual studio by Using this link: http://msdn.microsoft.com/en-us/library/dd286737.aspx
In the MTM support website there is a description on how to create a data collector. We will need to copy the code presented there to our new "Console Application" project and modify it so it will perform the task at hand.
b. Replace the "OnTestCaseEnd()" method with the following code:
We are using the MTM listener that can get several signals one of them is the "OnTestCaseEnd" which activate this method when occur. In this method we will call a different method called "getFilesToCollect()" which will explain next and inserting the files returned from it to the test result.
c. Add the .zip tools
We will add the reference assembly "System.IO.Compression.FileSystem" and "Using System.IO.Compression" to the project so we could use all of the utilities of the Zip Files. We will return a Zip folder from the method getFilesToCollect().
d. Replace the getFilesToCollect() method with the following code:
The path marked in yellow should be our path to the SeeTestAutomation reports folder on the host machine meaning the TFS-Server.
Step 2: Installing the collector
Now, after modifying the Collector code we will need to build our project and copy the files created by the build from the "build folder" to the "Datacollector" folder in the host machine. The build folder can be find in the "Build" properties of the project (right-click the project and go to "Properties"). The files to transfer are "%ProjectName%.dll" and "%ProjectName%.pdb" and the path to the DataCollector folder is: C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\DataCollectors.
We will only need to paste the files and restart the MTM for the changes to applied.
Use this link to understand more on how to install the collector files: http://msdn.microsoft.com/en-us/library/dd286708.aspx
Step 3: Set up the Collector in the MTM
After restarting the MTM we will navigate to the "Lab Center" and open our "Test Setting". In the section of "Data and Diagnostics" we should see the new data Collector we add.
a. We will select it to be enabled.
b. Click on "Finish" and run the test
d. Download the attached .zip file by clicking on it
e. Extract the files to launch the report in HTML format on your browser