diff --git a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
index 82db36a..117255f 100644
--- a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
+++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\FunctionalTests;
 
+use Behat\Mink\Exception\ElementNotFoundException;
+use Behat\Mink\Exception\ExpectationException;
 use Behat\Mink\Selector\Xpath\Escaper;
 use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Component\Utility\Xss;
@@ -262,12 +264,21 @@ protected function assertNoFieldByName($name, $value = '') {
    *   However, the default value ('') asserts that the field value is an empty
    *   string.
    *
+   * @throws \Behat\Mink\Exception\ElementNotFoundException
+   *
    * @deprecated Scheduled for removal in Drupal 9.0.0.
    *   Use $this->assertSession()->fieldExists() or
    *   $this->assertSession()->fieldValueEquals() instead.
    */
   protected function assertFieldById($id, $value = NULL) {
-    $this->assertFieldByName($id, $value);
+    $field = $this->getSession()->getPage()->findById($id);
+    if (empty($field)) {
+      throw new ElementNotFoundException($this->getSession()->getDriver(), 'form field', 'id', $field);
+    }
+
+    if ($value !== NULL) {
+      $this->assertEquals($value, $field->getValue());
+    }
   }
 
   /**
@@ -410,16 +421,28 @@ protected function assertNoLinkByHref($href) {
    *   while still checking that the field doesn't exist. However, the default
    *   value ('') asserts that the field value is not an empty string.
    *
+   * @throws \Behat\Mink\Exception\ExpectationException
+   *
    * @deprecated Scheduled for removal in Drupal 9.0.0.
    *   Use $this->assertSession()->fieldNotExists() or
    *   $this->assertSession()->fieldValueNotEquals() instead.
    */
   protected function assertNoFieldById($id, $value = '') {
-    if ($this->getSession()->getPage()->findField($id) && isset($value)) {
-      $this->assertSession()->fieldValueNotEquals($id, (string) $value);
+    $field = $this->getSession()->getPage()->findById($id);
+
+    // Manual test instead of assertNull() to keep the thrown exception the
+    // same.
+    if ($field === NULL) {
+      return;
     }
-    else {
-      $this->assertSession()->fieldNotExists($id);
+
+    if (!isset($value)) {
+      throw new ExpectationException(sprintf('Id "%s" appears on this page, but it should not.', $id), $this->getSession()->getDriver());
+    }
+    // Manual test instead of assertEquals() to keep the thrown exception the
+    // same.
+    elseif ($value === $field->getValue()) {
+      throw new ExpectationException(sprintf('Failed asserting that %s is not equal to %s', $field->getValue(), $value), $this->getSession()->getDriver());
     }
   }
 
diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
index f73084f..0dbe5af 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
@@ -172,7 +172,7 @@ public function testLegacyFieldAsserts() {
 
     // Test that the assertion fails correctly if no value is passed in.
     try {
-      $this->assertNoFieldById('description');
+      $this->assertNoFieldById('edit-description');
       $this->fail('The "description" field, with no value was not found.');
     }
     catch (ExpectationException $e) {
@@ -181,7 +181,7 @@ public function testLegacyFieldAsserts() {
 
     // Test that the assertion fails correctly if a NULL value is passed in.
     try {
-      $this->assertNoFieldById('name', NULL);
+      $this->assertNoFieldById('edit-name', NULL);
       $this->fail('The "name" field was not found.');
     }
     catch (ExpectationException $e) {
