【问题标题】:Where are the Selenium Logs when Running in Azure DevOps Server在 Azure DevOps 服务器中运行时 Selenium 日志在哪里
【发布时间】:2019-10-03 11:27:35
【问题描述】:

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

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

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

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

【问题讨论】:

  • 我认为你只能在附件中看到它们,ADOS 只显示错误日志。
  • 谢谢。我已经下载了附加的日志文件,但没有在其中找到我的任何日志消息。
  • @ShaykiAbramczyk - 我的立场是正确的。我可以在“附件”下的Standard_Console_Output.log 文件中看到来自ConsoleTraceDebugTestContext 的消息,用于“测试运行”中的失败测试。您想将此作为答案发布,以便我接受吗?
  • 当然 :) 谢谢。

标签: logging azure-devops azure-devops-server-2019


【解决方案1】:

https://docs.microsoft.com/en-us/azure/devops/pipelines/test/review-continuous-test-results-after-build?view=azure-devops 上的 Azure DevOps 文档说“如果您使用 Visual Studio 测试任务来运行测试,将出现从测试记录的诊断输出(使用任何 Console.WriteLine、Trace.WriteLine 或 TestContext.WriteLine 方法)作为失败测试的附件。”但是,在我的测试中,我发现情况并非如此。 Console.WriteLine 和 Trace.WriteLine 不会出现在附加的日志中。 TestContext.WriteLine 的输出确实出现在日志中,所以我目前正在使用它。

【讨论】:

  • 感谢@Michelle,欢迎来到 SO :)。我确实在附件Standard_Console_Output.log 中看到了.WriteLine() 的结果。我想知道为什么它对你不起作用?
【解决方案2】:

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

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

【讨论】:

    猜你喜欢
    • 2017-08-21
    • 1970-01-01
    • 2018-07-12
    • 2018-01-21
    • 2020-03-21
    • 2015-11-30
    • 1970-01-01
    • 2019-02-14
    • 2017-12-19
    相关资源
    最近更新 更多