【问题标题】:AngularJS protractor tests fail to startAngularJS量角器测试无法启动
【发布时间】:2014-04-15 08:59:56
【问题描述】:

我正在尝试在 RHEL 6.5 机器上使用 grunt 运行量角器。我验证它有 Firefox 来运行测试。

Selenium 服务器是使用“webdriver-manager update”安装的。 其他安装信息:

Node v0.11.12
grunt-cli v0.1.13
grunt v0.4.4
protractor 0.21.0
grunt-protractor-runner 0.2.4

我的量角器配置文件:

exports.config = {

  seleniumAddress: 'http://localhost:4444/wd/hub',

  capabilities: {
    'browserName': 'firefox'
  },

  specs: ['/test/example-spec.js'],

  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 20000
  },

  allScriptsTimeout: 20000

};

从 Jenkins 运行脚本或手动使用 grunt 失败并出现错误:

Running "protractor:e2e" (protractor) task
util.puts: Use console.log instead
Using the selenium server at http://localhost:4444/wd/hub
>>
Fatal error: protractor exited with code: null

我可以看到“webdriver-manager start”能够在端口 4444 上启动 selenium 服务器。 我找不到任何日志。我这里有什么遗漏吗?

编辑:在 grunt 中没有错误,用 --verbose 检查 grunt。看起来量角器插件在某个地方失败了。我会更深入地研究它。

【问题讨论】:

  • 有什么消息,你解决了吗?

标签: protractor angularjs-e2e


【解决方案1】:

我发现了firefox的问题,基本上我的量角器配置没有使用任何webdriver服务器设置而是使用默认服务器,这种方式非常方便,因为我没有自己启动selenium

为了解决这个问题,我自己启动了 selenium 服务器,专门针对 firefox 和 chrome 驱动程序

java -jar "C:\Users\%USERNAME%\AppData\Roaming\npm\node_modules\protractor\selenium\selenium-server-standalone-2.42.1.jar" -Dwebdriver.chrome.driver="C: \Users\%USERNAME%\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver.exe" -Dwebdriver.firefox.bin="C:\Users\%USERNAME%\AppData\Local\Mozilla Firefox\firefox.exe "

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-02
    • 2016-03-11
    • 2017-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-27
    • 1970-01-01
    相关资源
    最近更新 更多