microsoft-test-managertcm

MTM : Is there a way to find test run completion status using command line utility tcm.exe


I use MTM (Microsoft test manager) for running my automated test cases.

I schedule test runs using tcm /create command (trigerred from a powershell script) and once the test run is completed I need to copy the trx (result) file on my local machine. So I want to wait till the test run is completed in some sort of polling mechanism.

Hence, I need a command to fetch the current test run status using test runid. Is there a way to get MTM test run status in this way?


Solution

  • I don't think this is possible. The available switches for run option are:

    The only data you can take about runs using /list is

    you can see this by running:

    tcm run /list /planid:<plainId> /collection:<CollectionUrl> /teamproject:<TeamProject>
    

    Moreover, you don't have the runId yet so even if there was an option to get the completion status, in your case that would not be easy.

    So, I think you should start looking for another solution. Perhaps the TFS Api is what you need. Check these links:

    1. Automation test run creation using tfs api
    2. TFS 2010 API - Get Results of a Test Run