0

I am running a Selenium test, in C#, driven by MSTest in Azure DevOps Server 2019.

When I look in the logs for the Visual Studio Test task which runs the MSTest tests all I can see is that the test method has been discovered and that the test ran.

I have embedded calls to Console.WriteLine(), Debug.WriteLine() and Trace.WriteLine() in various places in my Selenium test but none of them ends up in the log.

How can I configure the ADOS pipeline to show me log messages coming in from my test?

urig
  • 16,016
  • 26
  • 115
  • 184
  • 1
    I think you can see them only in the attachment, ADOS displays only error logs. – Shayki Abramczyk Oct 03 '19 at 12:00
  • Thanks. I've downloaded the attached log files and did not find any of my log messages in them. – urig Oct 03 '19 at 12:08
  • @ShaykiAbramczyk - I stand corrected. I can see messages from `Console`, `Trace`, `Debug` and `TestContext` in the `Standard_Console_Output.log` file under "Attachments" for the failed test in "Test Runs". Would you like to post this as an answer so I can accept? – urig Oct 07 '19 at 08:08
  • Sure :) Thank you. – Shayki Abramczyk Oct 07 '19 at 08:22

2 Answers2

2

The Azure DevOps documentation at https://learn.microsoft.com/en-us/azure/devops/pipelines/test/review-continuous-test-results-after-build?view=azure-devops says "If you use the Visual Studio Test task to run tests, diagnostic output logged from tests (using any of Console.WriteLine, Trace.WriteLine or TestContext.WriteLine methods), will appear as an attachment for a failed test." However, in my testing I have found that is not the case. Console.WriteLine and Trace.WriteLine do not appear in the attached logs. Output from TestContext.WriteLine does appear in the logs, so I am currently using that.

Michelle
  • 21
  • 2
  • Thanks @Michelle and welcome to SO :). I do see the results of `.WriteLine()` in the attached `Standard_Console_Output.log`. I wonder why it doesn't work on your end? – urig Oct 07 '19 at 16:59
1

From my experience all the logs outputs not displayed in the Azure DevOps UI, but you can find them in the .log attachment.

Only the errors messages displayed in the Azure DevOps.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114