gpt4 book ai didi

javascript - Chrome 驱动程序在执行时间歇性挂起

转载 作者:行者123 更新时间:2023-11-29 16:02:55 25 4
gpt4 key购买 nike

我正在使用 Protractor 来自动化我的应用程序,我有大约 400 个要自动化的测试用例,我使用 jenkins 进行持续集成。

作为夜间执行的一部分,我每天都会通过 Jenkins 触发执行,但一段时间后 Chrome 驱动程序挂起,我无法看到浏览器。但是在 Jenkins 的控制台日志中我可以看到

[launcher] WebDriver 的 1 个实例仍在运行”,我看不到浏览器,我的执行无法继续进行,我不得不强行停止构建。

我在用

window 7 Protractor 2.5.1

我的示例 conf.js 文件

framework: 'jasmine',
jasmineNodeOpts: {
onComplete: null,

defaultTimeoutInterval: 120000,
},
'autoStartStopServer': true,
capabilities: {
'browserName': 'chrome',
shardTestFiles: true,
maxInstances: 1
},
suites: {
specs: '../specs/module1/*.js',

},

我在建议的解决方案中发现了类似的问题 herehere它说要添加 DBUS_SESSION_BUS_ADDRESS=/dev/null 但是如何在 Windows 中使用它,我们将不胜感激。

最佳答案

在命令提示符(不是 git bash 或 cywin)中尝试这个命令:

SET DBUS_SESSION_BUS_ADDRESS=/dev/null

要设置环境变量然后运行节点应用程序,请尝试以下命令:

SET DBUS_SESSION_BUS_ADDRESS=/dev/null&& node app.js

关于javascript - Chrome 驱动程序在执行时间歇性挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37943305/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com