diff --git a/core/modules/system/tests/modules/form_test/src/FormTestObject.php b/core/modules/system/tests/modules/form_test/src/FormTestObject.php
index 5fb0dae..e649030 100644
--- a/core/modules/system/tests/modules/form_test/src/FormTestObject.php
+++ b/core/modules/system/tests/modules/form_test/src/FormTestObject.php
@@ -34,6 +34,11 @@ public function buildForm(array $form, FormStateInterface $form_state) {
       '#type' => 'textfield',
       '#title' => $this->t('Bananas'),
     );
+    $form['strawberry'] = [
+      '#type' => 'hidden',
+      '#value' => 'red',
+      '#attributes' => ['id' => 'redstrawberryhiddenfield'],
+    ];
 
     $form['actions']['#type'] = 'actions';
     $form['actions']['submit'] = array(
diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
index d491e67..3ce88a9 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
@@ -73,6 +73,17 @@ public function testForm() {
     $this->assertSession()->elementExists('css', 'form#form-test-form-test-object');
     $this->assertSession()->fieldExists('bananas');
 
+    // Check that the hidden field exists and has a specific value.
+    $this->assertSession()->hiddenFieldExists('strawberry');
+    $this->assertSession()->hiddenFieldExists('red');
+    $this->assertSession()->hiddenFieldExists('redstrawberryhiddenfield');
+    $this->assertSession()->hiddenFieldValueNotEquals('strawberry', 'brown');
+    $this->assertSession()->hiddenFieldValueEquals('strawberry', 'red');
+
+    // Check that a hidden field does not exist.
+    $this->assertSession()->hiddenFieldNotExists('bananas');
+    $this->assertSession()->hiddenFieldNotExists('pineapple');
+
     $edit = ['bananas' => 'green'];
     $this->submitForm($edit, 'Save', 'form-test-form-test-object');
 
diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php
index f9f443c..ab79ec1 100644
--- a/core/tests/Drupal/Tests/BrowserTestBase.php
+++ b/core/tests/Drupal/Tests/BrowserTestBase.php
@@ -5,6 +5,7 @@
 use Behat\Mink\Driver\GoutteDriver;
 use Behat\Mink\Element\Element;
 use Behat\Mink\Mink;
+use Behat\Mink\Selector\SelectorsHandler;
 use Behat\Mink\Session;
 use Drupal\Component\FileCache\FileCacheFactory;
 use Drupal\Component\Serialization\Json;
@@ -362,7 +363,10 @@ protected function initMink() {
       $driver->getClient()->setClient($client);
     }
 
-    $session = new Session($driver);
+    $selectors_handler = new SelectorsHandler([
+      'hidden_field_selector' => new HiddenFieldSelector()
+    ]);
+    $session = new Session($driver, $selectors_handler);
     $this->mink = new Mink();
     $this->mink->registerSession('default', $session);
     $this->mink->setDefaultSessionName('default');
diff --git a/core/tests/Drupal/Tests/HiddenFieldSelector.php b/core/tests/Drupal/Tests/HiddenFieldSelector.php
new file mode 100644
index 0000000..b445c48
--- /dev/null
+++ b/core/tests/Drupal/Tests/HiddenFieldSelector.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Drupal\Tests;
+
+use Behat\Mink\Selector\PartialNamedSelector;
+
+/**
+ * Extends PartialNamedSelector to allow retrieval of hidden fields.
+ *
+ * @see \Behat\Mink\Selector\PartialNamedSelector
+ */
+class HiddenFieldSelector extends PartialNamedSelector {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function __construct() {
+    $xpath = ".//input[%lowercaseType% = 'hidden' and (%idOrNameMatch% or %valueMatch%)]";
+    $this->registerNamedXpath('hidden_field', $xpath);
+    parent::__construct();
+  }
+
+}
diff --git a/core/tests/Drupal/Tests/WebAssert.php b/core/tests/Drupal/Tests/WebAssert.php
index 6156dda..9eb9842 100644
--- a/core/tests/Drupal/Tests/WebAssert.php
+++ b/core/tests/Drupal/Tests/WebAssert.php
@@ -422,4 +422,83 @@ public function fieldDisabled($field, TraversableElement $container = NULL)  {
     return $node;
   }
 
+  /**
+   * Checks that specific hidden field exists.
+   *
+   * @param string $field
+   *   One of id|name|value for the hidden field.
+   * @param \Behat\Mink\Element\TraversableElement $container
+   *   (optional) The document to check against. Defaults to the current page.
+   *
+   * @return \Behat\Mink\Element\NodeElement
+   *   The matching element.
+   *
+   * @throws \Behat\Mink\Exception\ElementNotFoundException
+   */
+  public function hiddenFieldExists($field, TraversableElement $container = NULL) {
+    $container = $container ?: $this->session->getPage();
+    if ($node = $container->find('hidden_field_selector', ['hidden_field', $field])) {
+      return $node;
+    }
+    throw new ElementNotFoundException($this->session->getDriver(), 'form hidden field', 'id|name|value', $field);
+  }
+
+  /**
+   * Checks that specific hidden field does not exists.
+   *
+   * @param string $field
+   *   One of id|name|value for the hidden field.
+   * @param \Behat\Mink\Element\TraversableElement $container
+   *   (optional) The document to check against. Defaults to the current page.
+   *
+   * @throws \Behat\Mink\Exception\ExpectationException
+   */
+  public function hiddenFieldNotExists($field, TraversableElement $container = NULL) {
+    $container = $container ?: $this->session->getPage();
+    $node = $container->find('hidden_field_selector', ['hidden_field', $field]);
+    $this->assert($node === NULL, "A hidden field '$field' exists on this page, but it should not.");
+  }
+
+  /**
+   * Checks that specific hidden field have provided value.
+   *
+   * @param string $field
+   *   One of id|name|value for the hidden field.
+   * @param string $value
+   *   The hidden field value that needs to be checked.
+   * @param \Behat\Mink\Element\TraversableElement $container
+   *   (optional) The document to check against. Defaults to the current page.
+   *
+   * @throws \Behat\Mink\Exception\ElementNotFoundException
+   * @throws \Behat\Mink\Exception\ExpectationException
+   */
+  public function hiddenFieldValueEquals($field, $value, TraversableElement $container = NULL) {
+    $node = $this->hiddenFieldExists($field, $container);
+    $actual = $node->getValue();
+    $regex = '/^'.preg_quote($value, '/').'$/ui';
+    $message = "The hidden field '$field' value is '$actual', but '$value' expected.";
+    $this->assert((bool) preg_match($regex, $actual), $message);
+  }
+
+  /**
+   * Checks that specific hidden field doesn't have the provided value.
+   *
+   * @param string $field
+   *   One of id|name|value for the hidden field.
+   * @param string $value
+   *   The hidden field value that needs to be checked.
+   * @param \Behat\Mink\Element\TraversableElement $container
+   *   (optional) The document to check against. Defaults to the current page.
+   *
+   * @throws \Behat\Mink\Exception\ElementNotFoundException
+   * @throws \Behat\Mink\Exception\ExpectationException
+   */
+  public function hiddenFieldValueNotEquals($field, $value, TraversableElement $container = NULL) {
+    $node = $this->hiddenFieldExists($field, $container);
+    $actual = $node->getValue();
+    $regex = '/^'.preg_quote($value, '/').'$/ui';
+    $message = "The hidden field '$field' value is '$actual', but it should not be.";
+    $this->assert(!preg_match($regex, $actual), $message);
+  }
+
 }
