Brian Litzinger
Brian Litzinger

Reputation: 5608

Firefox 50 and Selenium 3.0 not working via Codeception tests

My acceptance tests were working, then I upgraded Firefox, and now they don't. I was using Firefox 46 and Selenium 2.53. Now I'm getting the following error:

"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"

The issue is, everything I've found talks about setting the system property, through what I assume, is Java. Codeception is PHP. Has anyone else encountered this and how did you resolve it?

In my acceptance.suite.yml file I added the marionette: false line, which does actually trigger Firefox to open (it won't open otherwise), but nothing happens afterward.

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

Upvotes: 1

Views: 527

Answers (1)

Naktibalda
Naktibalda

Reputation: 14100

This error is not about Codeception configuration, but about the way you start Selenium. You have to pass a correct path to geckodriver as a parameter.

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

In Selenium 2 -D parameters could be given after jar file. Selenium 3 is stricter and parameters must be given before jar file.

Upvotes: 1

Related Questions