Windows services testcafe E2E测试在CI服务器上运行时挂起Internet Explorer 11(由windows服务运行)

Windows services testcafe E2E测试在CI服务器上运行时挂起Internet Explorer 11(由windows服务运行),windows-services,automated-tests,internet-explorer-11,e2e-testing,testcafe,Windows Services,Automated Tests,Internet Explorer 11,E2e Testing,Testcafe,我使用testcafe运行E2E测试。当我使用命令行运行testcafe时,一切都正常。当测试由构建代理(windows服务)运行时,测试将挂起,但仅在Internet explorer上(chrome和FF工作)。我设法在Win10和WinServer2012上重现了这个问题。只有在所谓的会话零(由windows服务启动的GUI应用)中启动Internet Explorer时,问题才会出现。我已经尝试了不同的用户(LOCALSYSTEM和具有管理员权限的本地帐户),但总是得到相同的结果-测试挂

我使用testcafe运行E2E测试。当我使用命令行运行testcafe时,一切都正常。当测试由构建代理(windows服务)运行时,测试将挂起,但仅在Internet explorer上(chrome和FF工作)。我设法在Win10和WinServer2012上重现了这个问题。只有在所谓的会话零(由windows服务启动的GUI应用)中启动Internet Explorer时,问题才会出现。我已经尝试了不同的用户(LOCALSYSTEM和具有管理员权限的本地帐户),但总是得到相同的结果-测试挂起。当我通过login/psexec/runas运行浏览器时,一切正常。我也尝试过使用IE安全设置、防火墙和anitvirus。但问题依然存在。最后一个选项是使用VS debugger连接到浏览器并检查控制台是否有js错误,但在显示的地方没有错误

以前有人有过这样的问题吗?我会很感激任何关于如何调试这个问题的提示——因为我已经没有更多的想法了

从testcafe登录:

 UnhandledPromiseRejectionWarning: Error: The IE 11.0.0 / Windows 10.0.0 browser disconnected. This problem may appear when a brwser hangs or is closed, or due to network issues.
    at Timeout.<anonymous> (C:\Users\xxx\source\repos\ClientPortalSmokeTests\node_modules\testcafe\lib\browser\connection\index.js:23:34)
    at ontimeout (timers.js:482:11)
    at tryOnTimeout (timers.js:317:5)
    at Timer.listOnTimeout (timers.js:277:5)
(node:23936) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async funcion without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23936) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handld will terminate the Node.js process with a non-zero exit code.
UnhandledPromisejectionWarning:错误:IE 11.0.0/Windows 10.0.0浏览器已断开连接。当brwser挂起或关闭时,或由于网络问题,可能会出现此问题。
超时时。(C:\Users\xxx\source\repos\ClientPortalSmokeTests\node\u modules\testcafe\lib\browser\connection\index.js:23:34)
在ontimeout(timers.js:482:11)
在tryOnTimeout(timers.js:317:5)
at Timer.listOnTimeout(timers.js:277:5)
(节点:23936)未处理的PromisejectionWarning:未处理的承诺拒绝。此错误源于在没有catch块的情况下抛出异步函数的内部,或者拒绝未使用.catch()处理的承诺。(拒绝id:1)
(节点:23936)[DEP0018]弃用警告:未处理的承诺拒绝已弃用。将来,未处理的承诺拒绝将使用非零退出代码终止Node.js进程。
我可以看到两个选项

首先,尝试在登录选项卡下的服务属性中启用“允许服务与桌面交互”选项

如果这没有帮助,请尝试在非零会话中运行服务。以下线程可能会提供有关如何完成此任务的更多详细信息:


另外,据我所知,微软的立场是避免从windows服务运行UI应用程序。这被认为是坏习惯。以下是关于这件事的一些建议:。

我遇到了类似的问题。我的考试还没结束


我从IE11中删除了所有临时文件(通过Internet选项->删除所有临时文件),我的测试将再次运行。过了一会儿,测试又开始挂起

我已经试过了,但没有成功。TestCafe不使用任何需要与浏览器窗口交互的驱动程序(用于截图的工具除外)。相反,TC通过代理向您的应用程序公开自己的JS文件。