gpt4 book ai didi

javascript - PhantomJS Ghostdriver 停止

转载 作者:行者123 更新时间:2023-11-28 07:27:22 25 4
gpt4 key购买 nike

我正在尝试使用 phantomjs、ghostdriver 和 Protractor 在我的笔记本电脑上运行 e2e 测试。我运行以下命令:

  • phantomjs --webdriver=5000
  • gulp Protractor

当我运行第一个命令时,一切看起来都很好,但是当我运行第二个命令时,phantomjs.exe 会在几秒钟后崩溃(只是停止)。

phantomjs错误:

λ phantomjs --webdriver=5000
PhantomJS is launching GhostDriver...
[INFO - 2015-04-07T06:53:53.792Z] GhostDriver - Main - running on port 5000
[INFO - 2015-04-07T06:54:00.583Z] Session [dec7cd30-dcf2-11e4-b182-055bc0259fc0] - page.settings - {"XSSAuditi
ngEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loa
dImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKi
t/534.34 (KHTML, like Gecko) PhantomJS/1.9.8 Safari/534.34","webSecurityEnabled":true}
[INFO - 2015-04-07T06:54:00.583Z] Session [dec7cd30-dcf2-11e4-b182-055bc0259fc0] - page.customHeaders: - {}
[INFO - 2015-04-07T06:54:00.584Z] Session [dec7cd30-dcf2-11e4-b182-055bc0259fc0] - Session.negotiatedCapabilit
ies - {"browserName":"phantomjs","version":"1.9.8","driverName":"ghostdriver","driverVersion":"1.1.0","platform
":"windows-8-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":fal
se,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelector
sEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{
"proxyType":"direct"}}
[INFO - 2015-04-07T06:54:00.584Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: dec7cd
30-dcf2-11e4-b182-055bc0259fc0

gulp Protractor 错误:

   Error: ECONNREFUSED connect ECONNREFUSED
Stacktrace:
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (C:\Users\Eigenaar\Documents\3de_Academiejaar\Stage\GitHub_Repos\proj_Jesper\n
ode_modules\protractor\node_modules\selenium-webdriver\http\index.js:145:16)
at ClientRequest.emit (events.js:107:17)
at Socket.socketErrorListener (_http_client.js:272:9)
at Socket.emit (events.js:107:17)
at net.js:451:14
at process._tickCallback (node.js:355:11)
==== async task ====
Protractor.waitForAngular()
at ....

我的protractor.conf.js:

exports.config = {
rootElement: 'html',
seleniumAddress: 'http://127.0.0.1:5000',

capabilities: {
'browserName': 'phantomjs',
'phantomjs.binary.path': require('phantomjs').path
},

specs: [paths.e2e + '/**/*.js'],

jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};

最佳答案

问题已解决。当我使用 gulp 时,我忘记运行一个命令,这搞砸了整个项目......“gulpserve”是关键!现在他将使用 phantomJS 运行 e2e 测试。谢谢大家的帮助!真的很感激。

关于javascript - PhantomJS Ghostdriver 停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29485754/

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