【问题标题】:Running Selenium functional test in TFS 2015 vNext repeats 'InProgress' and eventually times out在 TFS 2015 vNext 中运行 Selenium 功能测试会重复“InProgress”并最终超时
【发布时间】:2017-04-23 14:38:52
【问题描述】:

我正在尝试使用 TFS 2015 上 vNext 构建定义中的运行功能测试步骤运行 Selenium 测试,测试项目的源代码构建在 TFS 服务器上并复制到运行 Windows 8.1 的远程计算机上。但是,在运行单元测试时,TFS 控制台中的重复消息“test is in state 'InProgress'”没有任何反应。在远程机器上的 DTAExecutionHost 日志文件中,重复以下行(从日志文件末尾开始的 sn-p)。

Web 方法运行:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] Web 方法响应:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] 15 ms V, 3872, 21, 2016/09/22, 13:45:05.769, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsync W, 3872, 21, 2016/09/22, 13:45:05.769, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand 收到无。重试。 W, 3872, 21, 2016/09/22, 13:45:05.769, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync:找不到队列。延迟 50000 毫秒。 V, 3872, 18, 2016/09/22, 13:45:55.773, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : 获取测试代理 Microsoft.TeamFoundation.Test.WebApi.TestAgent 的命令 Web 方法运行:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] Web 方法响应:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] 15 ms V, 3872, 19, 2016/09/22, 13:45:55.788, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsync W, 3872, 19, 2016/09/22, 13:45:55.788, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand 收到无。重试。 W, 3872, 19, 2016/09/22, 13:45:55.788, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync:找不到队列。延迟 50000 毫秒。 V, 3872, 17, 2016/09/22, 13:46:45.792, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : 获取测试代理 Microsoft.TeamFoundation.Test.WebApi.TestAgent 的命令 Web 方法运行:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] Web 方法响应:[https://.com/tfs/DefaultCollection/_apis/test/Agents/19/Commands/0] (GET)0[test] 16 ms V, 3872, 16, 2016/09/22, 13:46:45.808, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener:DispatchAsync W, 3872, 16, 2016/09/22, 13:46:45.808, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync : TestExecutionCommand 收到无。重试。 W, 3872, 16, 2016/09/22, 13:46:45.808, KLPC-607V\DTAExecutionHost, TestExecutionServiceCommandQueueListener.DispatchAsync:找不到队列。延迟 50000 毫秒。 一、4076、1、2016/09/22、14:48:08.685、158348745970、DTAExecutionHost.exe、Main.TryReadAndCacheVssCredentials获取Token信息 I, 4076, 1, 2016/09/22, 14:48:08.841, 158350330678, DTAExecutionHost.exe, 与令牌服务通信https://.com/tfs/DefaultCollection W, 4076, 1, 2016/09/22, 14:48:10.060, 158362406863, DTAExecutionHost.exe, 服务任务失败。重试 10。 W, 4076, 1, 2016/09/22, 14:48:13.106, 158392951673, DTAExecutionHost.exe, 服务任务失败。重试 9. W, 4076, 1, 2016/09/22, 14:48:16.121, 158423022807, DTAExecutionHost.exe, 服务任务失败。重试 8 次。

我在测试代理部署步骤中启用了交互选项,如下所示: Test Agent Deployment Configuration Step

欢迎任何反馈!

【问题讨论】:

  • 如果从测试代理手动运行测试,结果如何?
  • Eddie - 我是这里的新手。 “手动运行测试代理”是什么意思?任何指导表示赞赏!
  • 不是答案,而是建议。使用测试运行程序(“Visual Studio 测试”步骤)针对 Selenium 网格运行测试,无需 - 将程序集复制到另一台机器 - 测试代理 - 交互式运行构建代理 我们为 100 多个 Selenium 测试执行此操作,很少有与网格相关的超时问题.

标签: selenium tfs


【解决方案1】:

我在运行功能测试任务中运行 Selenium 测试时遇到了很多困难,但最终通过大量的反复试验让它正常工作。

首先,如果我是你,我会尝试在你想要测试的机器上安装一个交互式代理,并确保它通过 VS 测试任务在该机器上本地运行。如果是这样,那么您可以缩小问题的范围。

我使用的 Selenium 测试还需要指向 DLL 才能运行(我相信在我们的例子中它们是 NUnit)。因此,根据task,我创建了一个仅指定testadapterspath tag 的运行设置文件(如果在RM 中,请确保将dll 包含在drop 中)。当指向 runsettings 文件时,一定要指向构建/发布代理上的位置,而不是测试代理的位置(这有点欺骗了我)。

然后,如果您遇到 DTAExecutionHost 崩溃的问题(尝试双击安装在 C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE 的 exe),我想您仍然需要通过此GitHub post 联系 Microsoft,以便他们向您发送修补过的 exe。

更新:我还注意到错误指向“https://.com/...”,可能它没有正确找到您的 TFS 实例。我会尝试通过代理池和 VS 测试任务在本地运行测试,然后查看是否仍然给出相同的错误。

这可能无法直接解决您的问题,但可能会让您朝着正确的方向前进。希望对您有所帮助!

【讨论】:

  • Sachi - 感谢您的快速回复。因为我对这个平台有点陌生,所以我有很多问题。
  • 对于安装“交互式代理”的评论,您是否建议我在 Windows 8.1 机器上安装 TFS Build 代理?关于如何解决 DTAExecutionHost 找不到 TFS 服务器的任何建议?我试图避免在 TFS Build 服务器上本地运行 Selenium 测试,因为它是我们公司的生产机器。
  • 您可以创建一个单独的代理池并在您的本地计算机上安装一个交互式代理visualstudio.com/en-us/docs/build/admin/agents/v2-windows。我不确定如何对 DTAExecutionHost dll 进行故障排除。通过在github.com/Microsoft/vsts-tasks/issues 提交问题,我发现 Microsoft 的响应更成功,通常会在一天内回复。
猜你喜欢
  • 1970-01-01
  • 2018-12-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-18
  • 1970-01-01
相关资源
最近更新 更多