title: Behat with Selenium Hub and Firefox Error: Could not open connection: Payload received from webdriver is valid but unexpected json
body: <p>I'm trying to run Behat on Docker using <code>selenium/hub</code>, <code>selenium/node-chrome-debug</code> and <code>selenium/node-firefox-debug</code> images. </p>
  
  <p>Running Behat with the Chrome node is working, but the Firefox node gives me the following error:</p>
  
  <pre><code>Could not open connection: Payload received from webdriver is valid but unexpected json: {"value":{"sessionId":"244f4715-c59b-4bfc-aa17-8f6a867ead83","capabilities":{"moz:profile":"/tmp/rust_mozprofile.u3mB4xKf6nVD","rotatable":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"pageLoadStrategy":"normal","moz:headless":false,"moz:accessibilityChecks":false,"acceptInsecureCerts":false,"browserVersion":"57.0","platformVersion":"4.9.60-linuxkit-aufs","moz:processID":1005,"browserName":"firefox","platformName":"linux","moz:webdriverClick":false}}} (Behat\Mink\Exception\DriverException)
  </code></pre>
  
  <p>When I <code>vnc</code> to Firefox node, I see it opened Firefox, but nothing is happening.</p>
  
  <p>My <code>docker-compose.yml</code>:</p>
  
  <pre><code>version: '3.2'
  
  services:
    site.local:
      image: webdevops/php-apache-dev:7.1
      ports:
        - "8888:80"
      volumes:
        - ./public:/app
        - .:/application
  
    selenium-grid-hub.local:
      image: selenium/hub
      ports:
        - "4445:4444"
  
    selenium-node-chrome.local:
      image: selenium/node-chrome-debug
      environment:
        - HUB_PORT_4444_TCP_ADDR=selenium-grid-hub.local
        - HUB_PORT_4444_TCP_PORT=4444
      ports:
        - "5901:5900"
  
    selenium-node-firefox.local:
      image: selenium/node-firefox-debug
      environment:
        - HUB_PORT_4444_TCP_ADDR=selenium-grid-hub.local
        - HUB_PORT_4444_TCP_PORT=4444
      ports:
        - "5902:5900"
  </code></pre>
  
  <p>My <code>behat.yml</code>:</p>
  
  <pre><code>default:
    extensions:
      Behat\MinkExtension:
        base_url: "http://site.local"
        goutte:
          guzzle_parameters:
            verify: false
    suites:
      mysuite:
        paths:    [ %paths.base%/features ]
        contexts:
          - Zstate\BehatSeleniumDockerSkeleton\Tests\Behat\Context\FeatureContext
  
  chrome:
    extensions:
      Behat\MinkExtension:
        selenium2:
          browser: "chrome"
          wd_host: http://selenium-grid-hub.local:4444/wd/hub
          capabilities: {"browserName": "chrome", "browser": "chrome", 'chrome': {'switches':['--no-sandbox']}}
  
  firefox:
    extensions:
      Behat\MinkExtension:
        selenium2:
          browser: "firefox"
          wd_host: http://selenium-grid-hub.local:4444/wd/hub
          capabilities: {"browserName": "firefox", "browser": "firefox"}
  </code></pre>
  
  <p>I created this small <a href="https://github.com/zstate/behat-selenium-docker-skeleton" rel="nofollow noreferrer">repo</a> to replicate the issue.</p>
  
  <p>I would greatly appreciate any help or advice. Please let me know if I miss something in my question so I can update it.</p>