diff --git a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
index c88949d..866c4ba 100644
--- a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
+++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
@@ -223,9 +223,17 @@ protected function assertResponse($code) {
    *   $this->assertSession()->fieldValueEquals() instead.
    */
   protected function assertFieldByName($name, $value = NULL) {
-    $this->assertSession()->fieldExists($name);
+    /** @var \Behat\Mink\Element\NodeElement[] $fields */
+    $fields = $this->getSession()->getPage()->findAll('named', array('field', $name));
+    $this->assertNotEmpty($fields);
     if ($value !== NULL) {
-      $this->assertSession()->fieldValueEquals($name, (string) $value);
+      $found = FALSE;
+      foreach ($fields as $field) {
+        if ($field->getValue() == $value) {
+          $found = TRUE;
+        }
+      }
+      $this->assertTrue($found);
     }
   }
 
@@ -245,11 +253,26 @@ protected function assertFieldByName($name, $value = NULL) {
    *   $this->assertSession()->fieldValueNotEquals() instead.
    */
   protected function assertNoFieldByName($name, $value = '') {
-    if ($this->getSession()->getPage()->findField($name) && isset($value)) {
-      $this->assertSession()->fieldValueNotEquals($name, (string) $value);
+    /** @var \Behat\Mink\Element\NodeElement[] $fields */
+    $fields = $this->getSession()->getPage()->findAll('named', array('field', $name));
+
+    if (isset($value)) {
+      // If value specified then check array for match.
+      $found = TRUE;
+      if (isset($value)) {
+        $found = FALSE;
+        if ($fields) {
+          foreach ($fields as $field) {
+            if ($field->getValue() == $value) {
+              $found = TRUE;
+            }
+          }
+        }
+      }
+      $this->assertFalse($found);
     }
     else {
-      $this->assertSession()->fieldNotExists($name);
+      $this->assertEmpty($fields);
     }
   }
 
