Firefox 50 和 Selenium 3.0 无法通过 Codeception 测试工作

Firefox 50 and Selenium 3.0 not working via Codeception tests

我的验收测试工作正常,然后我升级了 Firefox,现在他们不工作了。我使用的是 Firefox 46 和 Selenium 2.53。现在我收到以下错误:

"The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases"

问题是,一切 我发现关于设置系统 属性 的讨论,据我推测,是 Java。密码是PHP。有没有其他人遇到过这个问题,你是如何解决的?

在我的 acceptance.suite.yml 文件中,我添加了 marionette: false 行,它确实会触发 Firefox 打开(否则不会打开),但之后什么也没有发生。

class_name: AcceptanceTester
modules:
  enabled:
  - \Helper\Acceptance
  - WebDriver:
      browser: firefox
      url: https://www.myexample.com/
      capabilities:
        marionette: false

此错误与 Codeception 配置无关,而是与您启动 Selenium 的方式有关。 您必须将正确的路径作为参数传递给 geckodriver。

java -jar -Dwebdriver.gecko.driver=~/geckodriver ~/selenium-server-standalone-x.xx.x.jar

在Selenium 2 -D 参数可以在jar 文件之后给出。 Selenium 3 更严格,必须在 jar 文件之前给出参数。