在 Azure DevOps Server 中 运行 时 Selenium 日志在哪里

Where are the Selenium Logs when Running in Azure DevOps Server

我是 运行 Selenium 测试,在 C# 中,由 Azure DevOps Server 2019 中的 MSTest 驱动。

当我查看运行 MSTest 测试的 Visual Studio Test task 的日志时,我只能看到测试方法已被发现并且测试 运行。

我在我的 Selenium 测试中的不同位置嵌入了对 Console.WriteLine()Debug.WriteLine()Trace.WriteLine() 的调用,但其中 none 最终出现在日志中。

如何配置 ADOS 管道以显示来自我的测试的日志消息?

https://docs.microsoft.com/en-us/azure/devops/pipelines/test/review-continuous-test-results-after-build?view=azure-devops 的 Azure DevOps 文档说 "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." 但是,在我的测试中我发现情况并非如此。 Console.WriteLine 和 Trace.WriteLine 没有出现在附加的日志中。 TestContext.WriteLine 的输出确实出现在日志中,所以我目前正在使用它。

根据我的经验,Azure DevOps UI 中未显示所有日志输出,但您可以在 .log 附件中找到它们。

仅在 Azure DevOps 中显示错误消息。