title: Azure devops: Screenshot are not showing in attachment tab
body: <p>I am trying to add failed test attachments in the Test tab in Azure DevOps using VS test task.</p>
  <p>I am calling the <a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/test/attachments/create%20test%20result%20attachment?view=azure-devops-rest-6.0" rel="nofollow noreferrer">Create Test Result Attachment</a> rest api,</p>
  <pre><code>$AzureDevOpsPAT = {PAT}
  $AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(&quot;:$($AzureDevOpsPAT)&quot;)) }
  $result = Invoke-RestMethod -Uri https://dev.azure.com/{org}/{proj}/_apis/test/runs/$(runId)/results?api-version=6.0 -Headers $AzureDevOpsAuthenicationHeader -Method Get
  
  #List all test result  get the test result ID via result
  foreach($Run in $result.value){
  
  #Get the test result ID via result
  If($Run.outcome -eq &quot;Failed&quot;){
  $TestResultID = $Run.id
  $Name=$Run.testCase.name
  Write-Host $TestResultID $Name
  
  
  #Add attachment via test run ID and test result ID
  $TestResultAttachmentURL = &quot;https://dev.azure.com/{org}/{proj}/_apis/test/Runs/$(runId)/results/$($TestResultID)/attachments?api-version=6.0-preview.1&quot; 
  
  $body =@&quot;
  {
    &quot;stream&quot;: &quot;abc&quot;,
    &quot;fileName&quot;: &quot;$(System.DefaultWorkingDirectory)/$Name.png&quot;,
    &quot;comment&quot;: &quot;Test attachment upload&quot;,
    &quot;attachmentType&quot;: &quot;GeneralAttachment&quot;
  }
  &quot;@
  $TestResultAttachmentResult = Invoke-RestMethod -Uri $TestResultAttachmentURL -ContentType &quot;application/json&quot; -Body $body -Headers $AzureDevOpsAuthenicationHeader -Method POST
  }
  }
  </code></pre>
  <p>I cant see the respective screenshot, the black flower is showing if I click on .png file in the attachment tab,
  <a href="https://i.stack.imgur.com/1Z79J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Z79J.png" alt="enter image description here" /></a></p>
  <p>Though I am capturing a screenshot in my code too,</p>
  <pre><code>protected void StopWebDriver()
          {
              if (WebDriver != null)
              {
               string path = Directory.GetCurrentDirectory() + &quot;\\&quot; + BaseConfig.TestCaseName + &quot;.png&quot;;
              ((ITakesScreenshot)WebDriver).GetScreenshot().SaveAsFile(path, ScreenshotImageFormat.Png);
              WebDriver.Close();
              WebDriver.Quit();
                  
              }
          }
  </code></pre>
  <p>Can anyone please tell me how can I see screenshots?</p>