diff --git a/core/modules/aggregator/src/Tests/ImportOpmlTest.php b/core/modules/aggregator/src/Tests/ImportOpmlTest.php
index f351cbc..30be661 100644
--- a/core/modules/aggregator/src/Tests/ImportOpmlTest.php
+++ b/core/modules/aggregator/src/Tests/ImportOpmlTest.php
@@ -42,7 +42,7 @@ public function openImportForm() {
     $this->assertText('A single OPML document may contain many feeds.', 'Found OPML help text.');
     $this->assertField('files[upload]', 'Found file upload field.');
     $this->assertField('remote', 'Found Remote URL field.');
-    $this->assertField('refresh', '', 'Found Refresh field.');
+    $this->assertField('refresh', 'Found Refresh field.');
   }
 
   /**
diff --git a/core/modules/language/src/Tests/LanguageBrowserDetectionTest.php b/core/modules/language/src/Tests/LanguageBrowserDetectionTest.php
index c66fce7..141b045 100644
--- a/core/modules/language/src/Tests/LanguageBrowserDetectionTest.php
+++ b/core/modules/language/src/Tests/LanguageBrowserDetectionTest.php
@@ -36,8 +36,8 @@ function testUIBrowserLanguageMappings() {
 
     // Check that defaults are loaded from language.mappings.yml.
     $this->drupalGet('admin/config/regional/language/detection/browser');
-    $this->assertField('edit-mappings-zh-cn-browser-langcode', 'zh-cn', 'Chinese browser language code found.');
-    $this->assertField('edit-mappings-zh-cn-drupal-langcode', 'zh-hans-cn', 'Chinese Drupal language code found.');
+    $this->assertFieldById('edit-mappings-zh-cn-browser-langcode', 'zh-cn', 'Chinese browser language code found.');
+    $this->assertOptionSelected('edit-mappings-zh-cn-drupal-langcode', 'zh-hans', 'Chinese Drupal language code found.');
 
     // Delete zh-cn language code.
     $browser_langcode = 'zh-cn';
@@ -69,8 +69,8 @@ function testUIBrowserLanguageMappings() {
     );
     $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, t('Save configuration'));
     $this->assertUrl(\Drupal::url('language.negotiation_browser', [], ['absolute' => TRUE]));
-    $this->assertField('edit-mappings-xx-browser-langcode', 'xx', 'Browser language code found.');
-    $this->assertField('edit-mappings-xx-drupal-langcode', 'en', 'Drupal language code found.');
+    $this->assertFieldById('edit-mappings-xx-browser-langcode', 'xx', 'Browser language code found.');
+    $this->assertOptionSelected('edit-mappings-xx-drupal-langcode', 'en', 'Drupal language code found.');
 
     // Add the same custom mapping again.
     $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, t('Save configuration'));
@@ -91,7 +91,7 @@ function testUIBrowserLanguageMappings() {
     );
     $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, t('Save configuration'));
     $this->assertUrl(\Drupal::url('language.negotiation_browser', [], ['absolute' => TRUE]));
-    $this->assertField('edit-mappings-xx-browser-langcode', 'xx', 'Browser language code found.');
-    $this->assertField('edit-mappings-xx-drupal-langcode', 'zh-hans', 'Drupal language code found.');
+    $this->assertFieldById('edit-mappings-xx-browser-langcode', 'xx', 'Browser language code found.');
+    $this->assertOptionSelected('edit-mappings-xx-drupal-langcode', 'zh-hans', 'Drupal language code found.');
   }
 }
diff --git a/core/modules/system/src/Tests/Form/ValidationTest.php b/core/modules/system/src/Tests/Form/ValidationTest.php
index 7b6c9e8..39cb055 100644
--- a/core/modules/system/src/Tests/Form/ValidationTest.php
+++ b/core/modules/system/src/Tests/Form/ValidationTest.php
@@ -53,12 +53,12 @@ function testValidate() {
       'name' => 'element_validate_access',
     );
     $this->drupalPostForm(NULL, $edit, 'Save');
-    $this->assertNoFieldByName('name', 'Form element was hidden.');
+    $this->assertNoField('name', 'Form element was hidden.');
     $this->assertText('Name value: element_validate_access', 'Value for inaccessible form element exists.');
 
     // Verify that value for inaccessible form element persists.
     $this->drupalPostForm(NULL, array(), 'Save');
-    $this->assertNoFieldByName('name', 'Form element was hidden.');
+    $this->assertNoField('name', 'Form element was hidden.');
     $this->assertText('Name value: element_validate_access', 'Value for inaccessible form element exists.');
 
     // Verify that #validate handlers don't run if the CSRF token is invalid.
diff --git a/core/modules/system/tests/modules/form_test/src/Callbacks.php b/core/modules/system/tests/modules/form_test/src/Callbacks.php
index 3d45894..3885254 100644
--- a/core/modules/system/tests/modules/form_test/src/Callbacks.php
+++ b/core/modules/system/tests/modules/form_test/src/Callbacks.php
@@ -37,6 +37,8 @@ public function validateName(&$element, FormStateInterface $form_state) {
     elseif ($form_state->has('form_test_name')) {
       // To simplify this test, just take over the element's value into $form_state.
       $form_state->setValueForElement($element, $form_state->get('form_test_name'));
+      // Alter the form element.
+      $element['#access'] = FALSE;
 
       $triggered = TRUE;
     }
diff --git a/core/modules/user/src/Tests/UserLanguageCreationTest.php b/core/modules/user/src/Tests/UserLanguageCreationTest.php
index 3b9c5b1..b246fa2 100644
--- a/core/modules/user/src/Tests/UserLanguageCreationTest.php
+++ b/core/modules/user/src/Tests/UserLanguageCreationTest.php
@@ -69,7 +69,7 @@ function testLocalUserCreation() {
     $this->drupalLogout();
 
     $this->drupalGet($langcode . '/user/register');
-    $this->assertNoFieldByName('language[fr]', 'Language selector is not accessible.');
+    $this->assertNoField('language[fr]', 'Language selector is not accessible.');
 
     $username = $this->randomMachineName(10);
     $edit = array(
diff --git a/core/modules/views/src/Tests/Handler/HandlerTest.php b/core/modules/views/src/Tests/Handler/HandlerTest.php
index 4904baf..89a1d3f 100644
--- a/core/modules/views/src/Tests/Handler/HandlerTest.php
+++ b/core/modules/views/src/Tests/Handler/HandlerTest.php
@@ -269,7 +269,7 @@ public function testRelationshipUI() {
     // Remove the relationship and make sure no relationship option appears.
     $this->drupalPostForm('admin/structure/views/nojs/handler/test_handler_relationships/default/relationship/nid', array(), t('Remove'));
     $this->drupalGet($handler_options_path);
-    $this->assertNoFieldByName($relationship_name, NULL, 'Make sure that no relationship option is available');
+    $this->assertNoField($relationship_name, NULL, 'Make sure that no relationship option is available');
 
     // Create a view of comments with node relationship.
     View::create(['base_table' => 'comment_field_data', 'id' => 'test_get_entity_type'])->save();
