【问题标题】:Firefox 50 and Selenium 3.0 not working via Codeception testsFirefox 50 和 Selenium 3.0 无法通过 Codeception 测试工作
【发布时间】:2017-05-27 21:50:43
【问题描述】:

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

“驱动程序可执行文件的路径必须由 webdriver.gecko.driver 系统属性设置;更多信息,请参阅https://github.com/mozilla/geckodriver。最新版本可以从https://github.com/mozilla/geckodriver/releases下载”

问题是,一切我发现关于设置系统属性的讨论,通过我的假设,是 Java。 Codeception 是 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

【问题讨论】:

  • 这与我在 100 个不同地方找到的信息完全相同,但它没有描述如何解决我遇到的问题。如果可以的话,我会否决这条评论。

标签: php selenium codeception


【解决方案1】:

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

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

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

【讨论】:

  • 谢谢,我试试这个方法。我下线的另一个建议是将 gecko 驱动程序添加到我的系统 PATH 中,这也可以。
猜你喜欢
  • 1970-01-01
  • 2017-02-26
  • 1970-01-01
  • 2019-01-02
  • 1970-01-01
  • 2020-03-11
  • 2016-08-01
相关资源
最近更新 更多