diff --git a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
index 78d4bee..82db36a 100644
--- a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
+++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
@@ -228,24 +228,27 @@ protected function assertFieldByName($name, $value = NULL) {
   }
 
   /**
-   * Asserts that a field exists with the given name and value.
+   * Asserts that a field does not exist with the given name and value.
    *
    * @param string $name
    *   Name of field to assert.
    * @param string $value
-   *   (optional) Value of the field to assert. You may pass in NULL (default)
-   *   to skip checking the actual value, while still checking that the field
-   *   exists.
+   *   (optional) Value for the field, to assert that the field's value on the
+   *   page does not match it. You may pass in NULL to skip checking the
+   *   value, while still checking that the field does not exist. However, the
+   *   default value ('') asserts that the field value is not an empty string.
    *
    * @deprecated Scheduled for removal in Drupal 9.0.0.
    *   Use $this->assertSession()->fieldNotExists() or
    *   $this->assertSession()->fieldValueNotEquals() instead.
    */
-  protected function assertNoFieldByName($name, $value = NULL) {
-    $this->assertSession()->fieldNotExists($name);
-    if ($value !== NULL) {
+  protected function assertNoFieldByName($name, $value = '') {
+    if ($this->getSession()->getPage()->findField($name) && isset($value)) {
       $this->assertSession()->fieldValueNotEquals($name, (string) $value);
     }
+    else {
+      $this->assertSession()->fieldNotExists($name);
+    }
   }
 
   /**
diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
index 4586c9a..f73084f 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
@@ -187,6 +187,29 @@ public function testLegacyFieldAsserts() {
     catch (ExpectationException $e) {
       $this->pass('The "name" field was found.');
     }
+
+    $this->assertNoFieldByName('name');
+    $this->assertNoFieldByName('name', 'not the value');
+    $this->assertNoFieldByName('notexisting');
+    $this->assertNoFieldByName('notexisting', NULL);
+
+    // Test that the assertion fails correctly if no value is passed in.
+    try {
+      $this->assertNoFieldByName('description');
+      $this->fail('The "description" field, with no value was not found.');
+    }
+    catch (ExpectationException $e) {
+      $this->pass('The "description" field, with no value was found.');
+    }
+
+    // Test that the assertion fails correctly if a NULL value is passed in.
+    try {
+      $this->assertNoFieldByName('name', NULL);
+      $this->fail('The "name" field was not found.');
+    }
+    catch (ExpectationException $e) {
+      $this->pass('The "name" field was found.');
+    }
   }
 
   /**
