Skip to content

Failed run Firefox Codeception #4539

@anhvuong123

Description

@anhvuong123

Hi everyone,

I've tried with Firefox test via CodeCeption but get the issue:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Facebook\WebDriver\Remote\DesiredCapabilities::__construct() must be of the type array, null given, called in C:\User\Ken\Desktop\SampleTestFirefox\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php on line 127 and defined in C:\User\Ken\Desktop\SampleTestFirefox\vendor\facebook\webdriver\lib\Remote\DesiredCapabilities.php:33
Stack trace:
#0 C:\User\Ken\Desktop\SampleTestFirefox\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php(127): Facebook\WebDriver\Remote\DesiredCapabilities->__construct(NULL)
#1 C:\User\Ken\Desktop\SampleTestFirefox\vendor\codeception\codeception\src\Codeception\Module\WebDriver.php(1421): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://127.0.0....', Object(Facebook\WebDriver\Remote\DesiredCapabilities), 0, 0, NULL, NULL)
#2 C:\User\Ken\Desktop\SampleTestFirefox\vendor\codeception\codeception\src\Codeception\Mod in C:\User\Ken\Desktop\SampleTestFirefox\vendor\facebook\webdriver\lib\Remote\DesiredCapabilities.php on line 33

Fatal error: Uncaught TypeError: Argument 1 passed to Facebook\WebDriver\Remote\DesiredCapabilities::__construct() must be of the type array, null given, called in C:\User\Ken\Desktop\SampleTestFirefox\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php on line 127 and defined in C:\User\Ken\Desktop\SampleTestFirefox\vendor\facebook\webdriver\lib\Remote\DesiredCapabilities.php:33
Stack trace:
#0 C:\User\Ken\Desktop\SampleTestFirefox\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php(127): Facebook\WebDriver\Remote\DesiredCapabilities->__construct(NULL)
#1 C:\User\Ken\Desktop\SampleTestFirefox\vendor\codeception\codeception\src\Codeception\Module\WebDriver.php(1421): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://127.0.0....', Object(Facebook\WebDriver\Remote\DesiredCapabilities), 0, 0, NULL, NULL)
#2 C:\User\Ken\Desktop\SampleTestFirefox\vendor\codeception\codeception\src\Codeception\Mod in C:\User\Ken\Desktop\SampleTestFirefox\vendor\facebook\webdriver\lib\Remote\DesiredCapabilities.php on line 33

========================
Please help me vi the case, I followed to http://codeception.com/docs/modules/WebDriver#Selenium to setup firefox config. My config from the file acceptance.suite.yml as below:

actor: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: 'https://accounts.google.com'
            browser: firefox
extensions:
    enabled:
        - Codeception\Extension\RunProcess:
            0: java -jar "selenium-server-standalone-3.5.3.jar" -Dwebdriver.gecko.driver=./geckodriver
            sleep: 5 # wait 5 seconds for processes to boot

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions