diff --git a/core/modules/system/tests/modules/test_page_test/src/Form/TestForm.php b/core/modules/system/tests/modules/test_page_test/src/Form/TestForm.php
index c619a7d..affe910 100644
--- a/core/modules/system/tests/modules/test_page_test/src/Form/TestForm.php
+++ b/core/modules/system/tests/modules/test_page_test/src/Form/TestForm.php
@@ -35,6 +35,12 @@ public function buildForm(array $form, FormStateInterface $form_state) {
       '#default_value' => 'Test name',
     ];
 
+    $form['description'] = [
+      '#type' => 'textfield',
+      '#title' => 'Description',
+      '#default_value' => '',
+    ];
+
     $form['options'] = [
       '#type' => 'select',
       '#title' => 'Options',
diff --git a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
index 1cf46fc..7ac72e9 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 b555fb6..976ddf1 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\FunctionalTests;
 
+use Behat\Mink\Exception\ExpectationException;
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Url;
 use Drupal\Tests\BrowserTestBase;
@@ -163,6 +164,19 @@ public function testLegacyXPathAsserts() {
 
     $this->assertNoFieldByXPath('//notexisting');
     $this->assertNoFieldByXPath("//input[@id = 'edit-name']", 'wrong value');
+
+    $this->assertNoFieldByName('name');
+    $this->assertNoFieldByName('name', 'not the value');
+    $this->assertNoFieldByName('notexisting');
+    $this->assertNoFieldByName('notexisting', NULL);
+
+    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.');
+    }
   }
 
   /**
