Search code examples
phpseleniumfunctional-testingbehat

Selenium Error communicating with the remote browser. It may have died


I have a problem with selenium when i try to run my functional tests with behat , my tests worked perfectly before , i only installed php7 instead of php5 I don't know if this is the cause of the problem or not i've also upgraded my ubuntu to 16.04.

this is the error message I get:

enter image description here

enter image description here

anyone can help me out with this please ?


Solution

  • You need to download latest geckodriver from here and Looking at the examples at this

    It seems like you need to do is set marionette to true in the desiered capabilities as below :-

    $capabilities->setCapability('marionette', true);
    

    Example:

    $host = 'http://localhost:4444/wd/hub';
    $capabilities = DesiredCapabilities::firefox();
    $capabilities->setCapability('marionette', true);
    $driver = RemoteWebDriver::create($host, $capabilities, 5000);