Extract Test Result attachment from MTM TFS 2012

Praseena Prasannan 1 Reputation point
2020-08-24T07:51:47.517+00:00

Hi team,

For one of the reporting purpose we need to download the MTM test result attachments into local folder. We are planning to automate this process and unable to find any solution.Could anyone help in suggesting a best way to dowload attachments from test run using testrunid.

Regards
Praseena

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
337 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 29,446 Reputation points Microsoft Vendor
    2020-08-25T07:29:17.587+00:00

    Hello Praseena,

    You can try to use API to get test result attachment. Please refer to this document Attachments – Get Test Result Attachment Zip, and use parameter runId then download a test result attachment by using (for example) https://{instance}/{collection}/{project}/_apis/test/Runs/{runId}/Results/{testCaseResultId}/attachments/{attachmentId}?api-version=5.0-preview.1

    Besides, it’s not possible to automate this process, you may need to download the attachments manually.

    Best Regards,
    Tianyu

    0 comments No comments