Amazon EC2上的Webdriverio + phantomjs错误:错误:连接ECONNREFUSED 127.0.0.1:4444

时间:2017-09-05 14:17:31

标签: selenium-webdriver amazon-ec2 phantomjs webdriver-io

我试图从中运行webdriverio + Phantomjs示例 (https://github.com/cognitom/webdriverio-examples/tree/master/wdio-phantomjs-only) 在远程服务器上。 (AWS ec2)

但是出错了

A service failed in the 'onPrepare' hook
Error: Exit code: 126
    at ChildProcess.<anonymous> (/home/ec2-user/wdio-phantomjs-only/node_modules/phantomjs-prebuilt/lib/phantomjs.js:117:18)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Continue...
ERROR: connect ECONNREFUSED 127.0.0.1:4444
phantomjs
Error: connect ECONNREFUSED 127.0.0.1:4444
ERROR: connect ECONNREFUSED 127.0.0.1:4444
phantomjs
Error: connect ECONNREFUSED 127.0.0.1:4444

然而,当我在本地机器上运行时。它工作正常。 我在ec2端检查了防火墙(安全组),但每个端口都是打开的。

这是 wide.conf.js

'use strict'

exports.config = {
  capabilities: [
    { browserName: 'phantomjs' }
    // If you want to use other browsers,
    // you may need local Selenium standalone server.
  ],
  services: ['phantomjs'],
  specs: [
    './test/e2e/*.js'
  ],
  exclude: [],
  maxInstances: 2,
  sync: true,
  logLevel: 'error',
  coloredLogs: true,
  waitforTimeout: 20000,
  connectionRetryTimeout: 90000,
  connectionRetryCount: 3,
  framework: 'mocha',
  reporters: ['spec'],
  mochaOpts: {
    ui: 'bdd',
    timeout: 30000
  }
}

的package.json

{
  "name": "webdriverio-example-wdio-wo-local-selenium",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "private": true,
  "scripts": {
    "test": "wdio test/wdio.conf.js"
  },
  "author": "Tsutomu Kawamura",
  "license": "MIT",
  "devDependencies": {
    "mocha": "^3.1.2",
    "wdio-mocha-framework": "^0.4.3",
    "wdio-phantomjs-service": "^0.2.2",
    "wdio-spec-reporter": "0.0.3",
    "webdriverio": "^4.2.16"
  }
}

有人可以给我一个如何解决这个问题的指南吗?

0 个答案:

没有答案