【问题标题】:Karma fails to launch IE on Team City buildKarma 无法在 Team City 构建中启动 IE
【发布时间】:2017-07-26 02:39:43
【问题描述】:

Karma 在 Team City 下运行时无法启动 IE。我可以登录服务器并从命令行运行测试,但 IE 在 Team City 中总是失败:

[Step 6/6] INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
[14:45:09][Step 6/6] INFO [launcher]: Starting browser Chrome
[14:45:09][Step 6/6] INFO [launcher]: Starting browser Firefox
[14:45:09][Step 6/6] INFO [launcher]: Starting browser IE
[14:45:25][Step 6/6] INFO [Firefox 38.0.0 (Windows 7 0.0.0)]: Connected on socket KeIupP7qx6Dn9ghM0KsX with id 75681035
[14:45:32][Step 6/6] INFO [Chrome 43.0.2357 (Windows 7 0.0.0)]: Connected on socket DORZdoNLQzPHx4ZT0KsY with id 61077412
[14:45:37][Step 6/6] INFO [IE 11.0.0 (Windows 7 0.0.0)]: Connected on socket 1p4cEWOQp6eKrUdO0KsZ with id 27572902
[14:45:47][Step 6/6] WARN [IE 11.0.0 (Windows 7 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
[14:45:47][Step 6/6] Chrome 43.0.2357 (Windows 7 0.0.0)
[14:45:47][Step 6/6] Firefox 38.0.0 (Windows 7 0.0.0)
[14:45:48][Step 6/6] Process exited with code 1

我尝试将 browserNoActivityTimeout 增加到 100000,但这没有帮助。

我们在 Windows 2008 R2 上运行 Team City 8.1.2。

任何建议将不胜感激。

【问题讨论】:

  • 运行代理的进程很可能与您登录的帐户不同。如果您可以在该帐户下运行该构建代理,那么您将能够比较它们。该过程是否需要交互式登录帐户?

标签: internet-explorer teamcity karma-runner


【解决方案1】:

问题是 IE 从未在我们用于 Team City 代理的服务帐户下运行。它卡在第一次运行浏览器时打开的 IE 选项对话框上。一旦我运行 IE 并接受它在构建服务器上运行的默认设置:

INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
[09:58:42]INFO [launcher]: Starting browser Chrome
[09:58:42]INFO [launcher]: Starting browser Firefox
[09:58:42]INFO [launcher]: Starting browser IE
[09:59:02]INFO [Firefox 38.0.0 (Windows 7 0.0.0)]: Connected on socket 1uAt8J2B8NPFj66W8Mib with id 61577635
[09:59:02]INFO [IE 11.0.0 (Windows 7 0.0.0)]: Connected on socket RPZgBEUhUGW2wD2h8Mic with id 95872295
[09:59:07]INFO [Chrome 43.0.2357 (Windows 7 0.0.0)]: Connected on socket mZzpKwFkIPpGY3vC8Mid with id 7944928
[09:59:08]Chrome 43.0.2357 (Windows 7 0.0.0)
[09:59:08]Firefox 38.0.0 (Windows 7 0.0.0)
[09:59:08]IE 11.0.0 (Windows 7 0.0.0)
[09:59:08]Process exited with code 0

【讨论】:

【解决方案2】:

@Kevin Kuszyk,您的解决方案也对我有用。

问题在于 Internet Explorer 11 首次启动时会为每个启动它的用户显示一个对话框窗口。

解决方案: 以 TeamCity 用户身份手动启动 IE。

要以您配置为运行 TeamCity 的服务用户身份启动 Internet Explorer,请在 IE 上shift + right click 并在菜单中选择以其他用户身份运行。将显示一个登录栏窗口 - 登录并继续。登录后,浏览器将启动并通过对话框提示您。选择您想要的选项并继续(提示禁用安全性)。下次您以该用户身份启动 Internet Explorer 时,该对话框将不会显示,因此 Karma 将能够运行其测试套件。

如果你将 TeamCity 作为本地系统运行,那就有点棘手了,因为你必须从微软下载psexec,然后在 powershell 中执行以下命令来启动 Internet Explorer:

psexec -sid "C:\Program Files\Internet Explorer\iexplore.exe"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-28
    相关资源
    最近更新 更多