-1

I'm using Codeception for acceptance testing. Selenium driver version 3.3.1 (selenium-server-standalone-3.3.1.jar) along with latest version of firefox 52 to test. I've already added geckodriver version 0.15 to the environment variable Path of Windows. But when running an acceptance test, I get the following error :

"[Error] Call to a member function get() on null "

In addition, I get the following warning in the selenium running terminal :

"The path to the driver executable must be set by the webdriver.gecko.driver system property"

The following is my acceptance.suite.yml file:

class_name: AcceptanceTester
    modules:
        enabled:
            - WebDriver:
            url: 'http://www.test.com/'
            browser: 'firefox'
            - Asserts
            - \Helper\Acceptance

To run the selenium driver, I run the following command:

java -jar tests\selenium-server-standalone-3.3.1.jar

And to run the test, I run the following command:

vendor\bin\codecept run tests\acceptance\TestCest.php

Does selenium can not read the path from environment variable Path of Windows?

Aref
  • 39
  • 1
  • 2
  • 11
  • Did you google the error messages? What did you find? What have you tried to solve the problem? Please read [ask] and [How much research effort is expected?](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) Please provide the code you have tried and the execution result including any error messages, etc. – JeffC Apr 15 '17 at 17:49
  • Dear @JeffC, yes I've googled the error message and haven't found anything otherwise I wouldn't bother to create a question ;). About the warning in the selenium ("The path to the driver executable must be set by the webdriver.gecko.driver system property"), I found that I should add the geckodriver path to the environment variable and I did that but nothing happend and the warning still exist. About coding, I've just added the configuration file of acceptance test. Please let me know if you need any additional code to check the problem. – Aref Apr 16 '17 at 06:04
  • Please run codecept with `-vvv` flag to get a full stacktrace. it shouldn't crash with fatal error. – Naktibalda Apr 16 '17 at 16:06

1 Answers1

0

Finally, I got it work by the following steps:

  1. Adding geckodriver executable file (geckodriver.exe) to System32 folder of windows installation folder
  2. Add the path to system environment variable Path (in system properties -> advanced -> environment variables -> system variables -> edit Path )
  3. Restart the Windows

It turns out that I have to copy the geckodriver executable file into system32 folder to be runnable by selenium driver (Before that, I added the path of geckodriver in different folder into Path environment variable and it didn't work.

Aref
  • 39
  • 1
  • 2
  • 11