【问题标题】:Protractor won't run chrome量角器不会运行 chrome
【发布时间】:2018-05-07 09:46:27
【问题描述】:

Protractor 运行良好,但突然不再运行 chrome。这是我当前的配置:

exports.config = {
    baseUrl: 'http://localhost:1384/#/',
    framework: 'jasmine',
    seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: ['./tests/e2e/*.js'],
    multiCapabilities: [{
      //'browserName': 'firefox',
      'browserName': 'chrome',
    }, 
    ],
    jasmineNodeOpts: {
      showColors: true
    }
  }

我正在运行最新的所有相关依赖项:

  • 量角器:"protractor": "^5.2.0",
  • chromedriver:2.33.506092
  • 网络驱动程序:selenium standalone version available: 3.7.1 [last]

当我运行 webdriver-manager start 时,一切都运行良好,然后运行 ​​protractor conf.js 在运行 selenium 服务器的窗口中给出以下输出:

Starting ChromeDriver 2.33.506092 Only local connections are allowed.

运行量角器配置的终端窗口出现以下错误:

E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally

我已经尝试过重新安装量角器并更新 chromedriver。运行测试在具有完全相同配置的 Firefox 中运行良好。

我也在使用 karma 运行测试,并且 karma 在 chrome 浏览器窗口中运行良好。

【问题讨论】:

  • 可能是chrome和chrome驱动版本不兼容?
  • 感谢指出,我运行的是版本62.0.3202.94(正式版)(64位),我运行的驱动也应该是最新的

标签: google-chrome selenium protractor


【解决方案1】:

directConnect: true 添加到您的配置文件中。它可能会帮助你。

【讨论】:

    【解决方案2】:

    这将是你的 conf 文件

    exports.config = {
      directConnect: true,
    
      // Capabilities to be passed to the webdriver instance.
      capabilities: {
        'browserName': 'chrome',
      },
    
      // Framework to use. Jasmine is recommended.
      framework: 'jasmine',
      baseUrl: "YOUR URL",
    
      // Spec patterns are relative to the current working directory when
      // protractor is called.
      specs: ['../Tests/test.js'],
    
    
      // Options to be passed to Jasmine.
      jasmineNodeOpts: {
        defaultTimeoutInterval: 30000
      },
        };
    

    您不需要提供以下依赖项,因为 chrome 仅从 conf 文件启动

    • chromedriver: 2.33.506092
    • webdriver:selenium 独立版本可用:3.7.1 [last]

    【讨论】:

      【解决方案3】:

      遇到了类似的问题。尝试更新 chrome 以获取新的兼容 chrome 驱动程序。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-09-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多