diff --git a/core/modules/simpletest/tests/src/FunctionalJavascript/BrowserWithJavascriptTest.php b/core/modules/simpletest/tests/src/FunctionalJavascript/BrowserWithJavascriptTest.php
index 572a842..0746ee5 100644
--- a/core/modules/simpletest/tests/src/FunctionalJavascript/BrowserWithJavascriptTest.php
+++ b/core/modules/simpletest/tests/src/FunctionalJavascript/BrowserWithJavascriptTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\simpletest\FunctionalJavascript;
 
+use Behat\Mink\Driver\Selenium2Driver;
+use Behat\Mink\Session;
 use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
 
 /**
@@ -11,6 +13,11 @@
  */
 class BrowserWithJavascriptTest extends JavascriptTestBase {
 
+  public function testSimple() {
+    $this->drupalGet('<front>');
+    $this->assertUrl('/');
+  }
+
   public function testJavascript() {
     $this->drupalGet('<front>');
     $session = $this->getSession();
@@ -22,8 +29,8 @@ public function testJavascript() {
         d = document,
         e = d.documentElement,
         g = d.getElementsByTagName('body')[0],
-        x = w.innerWidth || e.clientWidth || g.clientWidth,
-        y = w.innerHeight || e.clientHeight|| g.clientHeight;
+        x = w.outerWidth || e.clientWidth || g.clientWidth,
+        y = w.outerHeight || e.clientHeight|| g.clientHeight;
         return x == 400 && y == 300;
     }());
 JS;
@@ -53,4 +60,32 @@ public function testAssertJsCondition() {
     $this->assertJsCondition($javascript, 100);
   }
 
+  /**
+   * Tests behaviors related to clicking on elements with nested elements.
+   */
+  public function testNestedClick() {
+    $this->drupalGet('<front>');
+    $session = $this->getSession();
+
+    // Create an anchor element with a nested <div>.
+    $javascript = <<<JS
+    (function(){
+      var anchor = document.createElement('A');
+      anchor.href = '#my-anchor';
+      anchor.id = 'anchor-with-children';
+      var div = document.createElement('DIV');
+      div.innerHTML = 'test';
+      anchor.appendChild(div);
+      document.body.appendChild(anchor);
+    }());
+JS;
+    $session->executeScript($javascript);
+
+    // Attempt to click the anchor tag.
+    $this->click('#anchor-with-children');
+    $this->assertContains('#my-anchor', $session->getCurrentUrl());
+  }
+
+
+
 }
diff --git a/core/modules/simpletest/tests/src/FunctionalJavascript/StandardTest.php b/core/modules/simpletest/tests/src/FunctionalJavascript/StandardTest.php
new file mode 100644
index 0000000..7645618
--- /dev/null
+++ b/core/modules/simpletest/tests/src/FunctionalJavascript/StandardTest.php
@@ -0,0 +1,40 @@
+<?php
+use Behat\Mink\Driver\Selenium2Driver;
+use Behat\Mink\Session;
+use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+
+// Avoid unknown Drupal testbot injection / bug
+class SimplePhantomjsTest extends JavascriptTestBase
+{
+
+  public function testKeywordMatch() {
+    $session = $this->getSession();
+    $session->visit($this->getAbsoluteUrl('/'));
+
+    $page = $session->getPage();
+    $text = $page->getText();
+    $this->assertContains('Footer menu', $text);
+
+  }
+
+  public function testJavascript() {
+//    $this->drupalGet('<front>');
+    $session = $this->getSession();
+    $session->visit($this->getAbsoluteUrl('/'));
+
+    $session->resizeWindow(400, 300);
+    $javascript = <<<JS
+    (function(){
+        var w = window,
+        d = document,
+        e = d.documentElement,
+        g = d.getElementsByTagName('body')[0],
+        x = w.outerWidth || e.clientWidth || g.clientWidth,
+        y = w.outerHeight || e.clientHeight|| g.clientHeight;
+        return x == 400 && y == 300;
+    }());
+JS;
+    $this->assertJsCondition($javascript);
+  }
+
+}
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
index 116bd32..c018f36 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
@@ -3,8 +3,12 @@
 namespace Drupal\FunctionalJavascriptTests;
 
 use Drupal\Tests\BrowserTestBase;
-use Zumba\Mink\Driver\PhantomJSDriver;
-
+use Zend\Escaper\Escaper;
+//use Zumba\Mink\Driver\PhantomJSDriver;
+use Behat\Mink\Driver\Selenium2Driver;
+use Behat\Mink\Element\Element;
+use Behat\Mink\Mink;
+use Behat\Mink\Session;
 /**
  * Runs a browser test using PhantomJS.
  *
@@ -15,7 +19,7 @@
   /**
    * {@inheritdoc}
    */
-  protected $minkDefaultDriverClass = PhantomJSDriver::class;
+  protected $minkDefaultDriverClass = Selenium2Driver::class;
 
   /**
    * {@inheritdoc}
@@ -24,8 +28,8 @@ 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,
+      'firefox', // Optional: phantomjs, chrome (chromedriver must be inlcuded in your system path)
+//      $path,
     ];
     if (!file_exists($path)) {
       mkdir($path);
