Downloading DevOps Test Plan attahcments from individual Test Run Result Steps.

Mark Greiner 0 Reputation points
2024-06-28T13:11:59.5666667+00:00

I am using the REST API of Azure DevOps Test Plans. I have test a test case defined, where there are steps to be performed, and have executed test runs on it, where there are screenshots associated with each step.

I want to download those screenshots using the rest api.

I can get the info about those screenshots with the following endpoint:
https://vstmr.dev.azure.com/{my_organization}/{my_project}/_apis/testresults/runs/{run_id}/results?detailsToInclude=5

This returns an object that has the attribute

"iterationDetails": [
{

 "id": 1,

 "attachments": [  
        {  
            "name": "myFile.png", 

            "url": "https://dev.azure.com/MyCo/MyProj/_apis/test/Runs/8847/Results/100000/Iterations/1/TestResultAttachments"

...
}

...

]}
]

I take the url and try to make a GET request to it, and I get a 404: Not Found response.

This is perplexing. Why would Azure reply with a URL that does not resolve?

Am I missing something here?

Is there another way to get those attachments?

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.
336 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 28,931 Reputation points Microsoft Vendor
    2024-07-01T02:52:53.5933333+00:00

    Hello @Mark Greiner ,

    Thank you for taking time to post this issue in Microsoft Q&A forum.

    About REST API and Azure DevOps Test Plans question, you can kindly post it on our Developer Community – Azure DevOps for better help(as Azure DevOps is currently not supported in the Microsoft Q&A forums).

    Thanks for your understanding, have a nice day.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments