diff --git a/composer.json b/composer.json
index c55a9a3..0461510 100644
--- a/composer.json
+++ b/composer.json
@@ -40,5 +40,8 @@
         "post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
         "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
         "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup"
+    },
+    "require-dev": {
+        "behat/mink-selenium2-driver": "^1.3"
     }
 }
diff --git a/composer.lock b/composer.lock
index 10aaa10..838a9a3 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "64b08387a4402f685cc35b1ad9197380",
-    "content-hash": "0e7de9d6c3256344615aad4b059a850a",
+    "hash": "65cc2026a06eff069bb528d5b32c2bfb",
+    "content-hash": "4e3f87cca69fd0c93ace9a5d45076ad0",
     "packages": [
         {
             "name": "asm89/stack-cors",
@@ -1100,12 +1100,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/php-fig/log.git",
-                "reference": "1.0.0"
+                "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/php-fig/log/zipball/1.0.0",
-                "reference": "1.0.0",
+                "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
+                "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
                 "shasum": ""
             },
             "type": "library",
@@ -2927,6 +2927,67 @@
             "time": "2016-03-05 09:04:22"
         },
         {
+            "name": "behat/mink-selenium2-driver",
+            "version": "v1.3.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/minkphp/MinkSelenium2Driver.git",
+                "reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/473a9f3ebe0c134ee1e623ce8a9c852832020288",
+                "reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288",
+                "shasum": ""
+            },
+            "require": {
+                "behat/mink": "~1.7@dev",
+                "instaclick/php-webdriver": "~1.1",
+                "php": ">=5.3.1"
+            },
+            "require-dev": {
+                "symfony/phpunit-bridge": "~2.7"
+            },
+            "type": "mink-driver",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.3.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Behat\\Mink\\Driver\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Konstantin Kudryashov",
+                    "email": "ever.zet@gmail.com",
+                    "homepage": "http://everzet.com"
+                },
+                {
+                    "name": "Pete Otaqui",
+                    "email": "pete@otaqui.com",
+                    "homepage": "https://github.com/pete-otaqui"
+                }
+            ],
+            "description": "Selenium2 (WebDriver) driver for Mink framework",
+            "homepage": "http://mink.behat.org/",
+            "keywords": [
+                "ajax",
+                "browser",
+                "javascript",
+                "selenium",
+                "testing",
+                "webdriver"
+            ],
+            "time": "2016-03-05 09:10:18"
+        },
+        {
             "name": "doctrine/instantiator",
             "version": "1.0.5",
             "source": {
@@ -3030,122 +3091,62 @@
             "time": "2015-11-05 12:58:44"
         },
         {
-            "name": "jcalderonzumba/gastonjs",
-            "version": "v1.0.2",
+            "name": "instaclick/php-webdriver",
+            "version": "1.4.3",
             "source": {
                 "type": "git",
-                "url": "https://github.com/jcalderonzumba/gastonjs.git",
-                "reference": "21bebb8ca03eb0f93ec2f3fad61192fb079e2622"
+                "url": "https://github.com/instaclick/php-webdriver.git",
+                "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/jcalderonzumba/gastonjs/zipball/21bebb8ca03eb0f93ec2f3fad61192fb079e2622",
-                "reference": "21bebb8ca03eb0f93ec2f3fad61192fb079e2622",
+                "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/0c20707dcf30a32728fd6bdeeab996c887fdb2fb",
+                "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb",
                 "shasum": ""
             },
             "require": {
-                "guzzlehttp/guzzle": "~5.0|~6.0",
-                "php": ">=5.4"
+                "ext-curl": "*",
+                "php": ">=5.3.2"
             },
             "require-dev": {
-                "phpunit/phpunit": "~4.6",
-                "silex/silex": "~1.2",
-                "symfony/phpunit-bridge": "~2.7",
-                "symfony/process": "~2.1"
+                "satooshi/php-coveralls": "dev-master"
             },
-            "type": "phantomjs-api",
+            "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.1.x-dev"
+                    "dev-master": "1.4.x-dev"
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "Zumba\\GastonJS\\": "src"
+                "psr-0": {
+                    "WebDriver": "lib/"
                 }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
-                "MIT"
+                "Apache-2.0"
             ],
             "authors": [
                 {
-                    "name": "Juan Francisco Calderón Zumba",
-                    "email": "juanfcz@gmail.com",
-                    "homepage": "http://github.com/jcalderonzumba"
-                }
-            ],
-            "description": "PhantomJS API based server for webpage automation",
-            "homepage": "https://github.com/jcalderonzumba/gastonjs",
-            "keywords": [
-                "api",
-                "automation",
-                "browser",
-                "headless",
-                "phantomjs"
-            ],
-            "time": "2016-01-18 09:21:03"
-        },
-        {
-            "name": "jcalderonzumba/mink-phantomjs-driver",
-            "version": "v0.3.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/jcalderonzumba/MinkPhantomJSDriver.git",
-                "reference": "782892dbea4af7d04024374672b3790b6c008def"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/782892dbea4af7d04024374672b3790b6c008def",
-                "reference": "782892dbea4af7d04024374672b3790b6c008def",
-                "shasum": ""
-            },
-            "require": {
-                "behat/mink": "~1.6",
-                "jcalderonzumba/gastonjs": "~1.0",
-                "php": ">=5.4",
-                "twig/twig": "~1.20|~2.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.6",
-                "silex/silex": "~1.2",
-                "symfony/css-selector": "~2.1",
-                "symfony/phpunit-bridge": "~2.7",
-                "symfony/process": "~2.3"
-            },
-            "type": "mink-driver",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "0.4.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Zumba\\Mink\\Driver\\": "src"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
+                    "name": "Justin Bishop",
+                    "email": "jubishop@gmail.com",
+                    "role": "Developer"
+                },
                 {
-                    "name": "Juan Francisco Calderón Zumba",
-                    "email": "juanfcz@gmail.com",
-                    "homepage": "http://github.com/jcalderonzumba"
+                    "name": "Anthon Pang",
+                    "email": "apang@softwaredevelopment.ca",
+                    "role": "Fork Maintainer"
                 }
             ],
-            "description": "PhantomJS driver for Mink framework",
-            "homepage": "http://mink.behat.org/",
+            "description": "PHP WebDriver for Selenium 2",
+            "homepage": "http://instaclick.com/",
             "keywords": [
-                "ajax",
                 "browser",
-                "headless",
-                "javascript",
-                "phantomjs",
-                "testing"
+                "selenium",
+                "webdriver",
+                "webtest"
             ],
-            "time": "2015-12-04 13:55:02"
+            "time": "2015-06-15 20:19:33"
         },
         {
             "name": "mikey179/vfsStream",
diff --git a/core/composer.json b/core/composer.json
index ba488e5..9c81e6e 100644
--- a/core/composer.json
+++ b/core/composer.json
@@ -37,8 +37,6 @@
     "require-dev": {
         "behat/mink": "~1.7",
         "behat/mink-goutte-driver": "~1.2",
-        "jcalderonzumba/gastonjs": "~1.0.2",
-        "jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
         "mikey179/vfsStream": "~1.2",
         "phpunit/phpunit": "~4.8",
         "symfony/css-selector": "~2.8"
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php b/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php
index e69de29..35a4cfb 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace Drupal\FunctionalJavascriptTests;
+
+use Behat\Mink\Driver\Selenium2Driver;
+
+/**
+ * Phantomjs requried domain in setCookie.
+ */
+class DrupalSelenium2Driver extends Selenium2Driver
+{
+  /**
+   * {@inheritdoc}
+   */
+  public function setCookie($name, $value = null)
+  {
+    if (null === $value) {
+      $this->getWebDriverSession()->deleteCookie($name);
+
+      return;
+    }
+
+    $cookieArray = array(
+      'name'   => $name,
+      'value'  => urlencode($value),
+      'secure' => false, // thanks, chibimagic!
+      'domain' => parse_url($this->getWebDriverSession()->url(), PHP_URL_HOST) // drupal-fixes: phantomjs hack
+    );
+
+    $this->getWebDriverSession()->setCookie($cookieArray);
+
+  }
+}
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
index 8d3ff47..9555c15 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
@@ -28,4 +28,26 @@ public function assertWaitOnAjaxRequest($timeout = 10000, $message = 'Unable to
     }
   }
 
+  /**
+   * Overrides statusCodeEquals function. Use Functional tests for status code validation
+   *
+   * @param int $code
+   *
+   */
+  public function statusCodeEquals($code)
+  {
+    // should we throw an error?
+  }
+
+  /**
+   * Overrides statusCodeEquals function. Use Functional tests for status code validation
+   *
+   * @param int $code
+   *
+   */
+  public function statusCodeNotEquals($code)
+  {
+    // should we throw an error?
+  }
+
 }
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
index 3661006..96789dd 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
@@ -2,9 +2,9 @@
 
 namespace Drupal\FunctionalJavascriptTests;
 
+use Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver;
+use Behat\Mink\Exception\DriverException;
 use Drupal\Tests\BrowserTestBase;
-use Zumba\GastonJS\Exception\DeadClient;
-use Zumba\Mink\Driver\PhantomJSDriver;
 
 /**
  * Runs a browser test using PhantomJS.
@@ -16,29 +16,24 @@
   /**
    * {@inheritdoc}
    */
-  protected $minkDefaultDriverClass = PhantomJSDriver::class;
+  protected $minkDefaultDriverClass = DrupalSelenium2Driver::class;
 
   /**
    * {@inheritdoc}
    */
   protected function initMink() {
     // Set up the template cache used by the PhantomJS mink driver.
-    $path = $this->tempFilesDirectory . DIRECTORY_SEPARATOR . 'browsertestbase-templatecache';
     $this->minkDefaultDriverArgs = [
-      'http://127.0.0.1:8510',
-      $path,
+      'phantomjs',
     ];
-    if (!file_exists($path)) {
-      mkdir($path);
-    }
 
     try {
       return parent::initMink();
     }
-    catch (DeadClient $e) {
-      $this->markTestSkipped('PhantomJS is either not installed or not running. Start it via phantomjs --ssl-protocol=any --ignore-ssl-errors=true vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768&');
+    catch (DriverException $e) {
+      $this->markTestSkipped($e->getMessage());
     }
-    catch (Exception $e) {
+    catch (\Exception $e) {
       $this->markTestSkipped('An unexpected error occurred while starting Mink: ' . $e->getMessage());
     }
   }
diff --git a/core/tests/README.md b/core/tests/README.md
index 566fa23..3c38201 100644
--- a/core/tests/README.md
+++ b/core/tests/README.md
@@ -2,16 +2,11 @@
 
 ## Functional tests
 
-* Start PhantomJS:
-  ```
-  phantomjs --ssl-protocol=any --ignore-ssl-errors=true ./vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /dev/null &
-  ```
 * Run the functional tests:
   ```
   export SIMPLETEST_DB='mysql://root@localhost/dev_d8'
   export SIMPLETEST_BASE_URL='http://d8.dev'
   ./vendor/bin/phpunit -c core --testsuite functional
-  ./vendor/bin/phpunit -c core --testsuite functional-javascript
   ```
 
 Note: functional tests have to be invoked with a user in the same group as the
@@ -46,3 +41,29 @@ export SIMPLETEST_BASE_URL='http://d8.dev'
 sudo -u www-data -E ./vendor/bin/phpunit -c core --testsuite functional
 sudo -u www-data -E ./vendor/bin/phpunit -c core --testsuite functional-javascript
 ```
+
+## Functional javascript tests
+
+* Start PhantomJS:
+  ```
+  phantomjs --webdriver=4444
+  ```
+
+* Run the functional javascript tests:
+
+```
+  ./vendor/bin/phpunit -c core --testsuite functional-javascript
+```
+
+* Alternative to use phantomjs you can also use a real browser like
+  firefox/chrome too actually see what the test is doing.
+
+* Install and start selenium, see http://mink.behat.org/en/latest/drivers/selenium2.html
+* Set an additional environment parameter to tell the test to use firefox:
+```
+export MINK_DRIVER_ARGS='["firefox", null, "http://localhost:4444/wd/hub"]'
+```
+* Run the tests as before, now a firefox window should appear.
+```
+  ./vendor/bin/phpunit -c core --testsuite functional-javascript
+```
