diff --git a/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php b/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php
index a558cda938..9a34ac3038 100644
--- a/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php
@@ -88,16 +88,12 @@ public function testCommentStatusFieldAccessStatus() {
     $this->drupalGet('node/add/article');
     $assert = $this->assertSession();
     $assert->fieldNotExists('comment[0][status]');
-    $this->submitForm([
-      'title[0][value]' => 'Node 1',
-    ], t('Save'));
+    $this->submitForm(['title[0][value]' => 'Node 1'], 'Save');
     $assert->fieldExists('subject[0][value]');
     $this->drupalLogin($this->commentAdmin);
     $this->drupalGet('node/add/article');
     $assert->fieldExists('comment[0][status]');
-    $this->submitForm([
-      'title[0][value]' => 'Node 2',
-    ], t('Save'));
+    $this->submitForm(['title[0][value]' => 'Node 2'], 'Save');
     $assert->fieldExists('subject[0][value]');
   }
 
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
index 5714e0fa27..f43b3d4189 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
@@ -66,7 +66,7 @@ public function testModerationForm() {
     $this->assertSession()->optionNotExists('moderation_state[0][state]', 'archived');
 
     // Create new moderated content in draft.
-    $this->submitForm(['moderation_state[0][state]' => 'draft'], t('Save'));
+    $this->submitForm(['moderation_state[0][state]' => 'draft'], 'Save');
 
     $node = $this->drupalGetNodeByTitle('Some moderated content');
     $canonical_path = sprintf('node/%d', $node->id());
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php
index 69170c32b1..037402c1f0 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php
@@ -53,7 +53,7 @@ public function testDisableSetting() {
       $translatable_checkbox => TRUE,
       $language_alterable => TRUE,
     ];
-    $this->submitForm($edit, t('Save configuration'));
+    $this->submitForm($edit, 'Save configuration');
 
     $assert->pageTextContains(t('Settings successfully updated.'));
 
@@ -64,7 +64,7 @@ public function testDisableSetting() {
       $translatable_checkbox => TRUE,
       $language_alterable => TRUE,
     ];
-    $this->submitForm($edit, t('Save configuration'));
+    $this->submitForm($edit, 'Save configuration');
 
     $assert->pageTextContains(t('Settings successfully updated.'));
 
diff --git a/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php b/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php
index 865f3e055a..971ded2aa4 100644
--- a/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php
+++ b/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php
@@ -94,7 +94,7 @@ public function testFileUploadErrors() {
     $edit = [
       'edit-title-0-value' => $this->randomString(),
     ];
-    $this->submitForm($edit, t('Save'));
+    $this->submitForm($edit, 'Save');
 
     $error_text = $this->getSession()->getPage()->find('css', '.field--name-field-ief-file .form-item--error-message')->getText();
 
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php
index d1972b529a..d17fc5336e 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php
@@ -58,10 +58,10 @@ public function testMigrateUpgradeExecute() {
 
     // Start the upgrade process.
     $this->drupalGet('/upgrade');
-    $this->submitForm([], t('Continue'));
-    $this->submitForm($edits, t('Review upgrade'));
-    $this->submitForm([], t('I acknowledge I may lose data. Continue anyway.'));
-    $this->submitForm([], t('Perform upgrade'));
+    $this->submitForm([], 'Continue');
+    $this->submitForm($edits, 'Review upgrade');
+    $this->submitForm([], 'I acknowledge I may lose data. Continue anyway.');
+    $this->submitForm([], 'Perform upgrade');
 
     // Tests the migration log contains an error message.
     $migration = $this->getMigrationPluginManager()->createInstance('d7_file');
diff --git a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
index 07c9abe6ae..e872446254 100644
--- a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
+++ b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
@@ -244,7 +244,7 @@ public function testUserPasswordResetPreferredLanguage($setPreferredLangcode, $a
     // Test password reset with language prefixes.
     $this->drupalGet($visitingUrl);
     $edit = ['name' => $this->account->getAccountName()];
-    $this->submitForm($edit, t('Submit'));
+    $this->submitForm($edit, 'Submit');
     $this->assertValidPasswordReset($edit['name']);
 
     $resetURL = $this->getResetURL();
diff --git a/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php
index 86d7b5adf9..8a8e864106 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php
@@ -63,7 +63,7 @@ public function testExposedFilteringAndReset() {
     $this->assertStringContainsString('Article A', $html);
 
     // Filter by page type.
-    $this->submitForm(['type' => 'page'], t('Apply'));
+    $this->submitForm(['type' => 'page'], 'Apply');
     $this->assertSession()->waitForElementRemoved('xpath', '//*[text()="Article A"]');
 
     // Verify that only the page nodes are present.
@@ -73,7 +73,7 @@ public function testExposedFilteringAndReset() {
     $this->assertStringNotContainsString('Article A', $html);
 
     // Reset the form.
-    $this->submitForm([], t('Reset'));
+    $this->submitForm([], 'Reset');
     // Assert we are still on the node page.
     $html = $page->getHtml();
     // Repeat the original tests.
@@ -87,9 +87,9 @@ public function testExposedFilteringAndReset() {
     // is redirected to the page display.
     $this->drupalPlaceBlock('views_block:test_block_exposed_ajax_with_page-block_1');
     $this->drupalGet($node->toUrl());
-    $this->submitForm(['type' => 'page'], t('Apply'));
+    $this->submitForm(['type' => 'page'], 'Apply');
     $this->assertSession()->waitForElementRemoved('xpath', '//*[text()="Article A"]');
-    $this->submitForm([], t('Reset'));
+    $this->submitForm([], 'Reset');
     $this->assertSession()->addressEquals('some-path');
   }
 
diff --git a/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php
index 25d4d90718..0cbfd93766 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php
@@ -67,7 +67,7 @@ public function testExposedFiltering() {
     $this->assertStringContainsString('Page Two', $html);
 
     // Search for "Page One".
-    $this->submitForm(['title' => 'Page One'], t('Filter'));
+    $this->submitForm(['title' => 'Page One'], 'Filter');
     $this->assertSession()->assertWaitOnAjaxRequest();
 
     // Verify that only the "Page One" Node is present.
@@ -76,7 +76,7 @@ public function testExposedFiltering() {
     $this->assertStringNotContainsString('Page Two', $html);
 
     // Search for "Page Two".
-    $this->submitForm(['title' => 'Page Two'], t('Filter'));
+    $this->submitForm(['title' => 'Page Two'], 'Filter');
     $this->assertSession()->assertWaitOnAjaxRequest();
 
     // Verify that only the "Page Two" Node is present.
@@ -89,13 +89,13 @@ public function testExposedFiltering() {
     $this->submitForm([
       'action' => 'node_make_sticky_action',
       'node_bulk_form[0]' => TRUE,
-    ], t('Apply to selected items'));
+    ], 'Apply to selected items');
 
     // Verify that the action was performed.
     $this->assertSession()->pageTextContains('Make content sticky was applied to 1 item.');
 
     // Reset the form.
-    $this->submitForm([], t('Reset'));
+    $this->submitForm([], 'Reset');
     $this->assertSession()->assertWaitOnAjaxRequest();
 
     $this->assertSession()->pageTextContains('Page One');
diff --git a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
index df76829fad..90d77e8849 100644
--- a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
+++ b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
@@ -228,7 +228,7 @@ protected function drupalLoginWithPassword(AccountInterface $account, $password)
     $this->submitForm([
       'name' => $account->getAccountName(),
       'pass' => $password,
-    ], t('Log in'));
+    ], 'Log in');
 
     // @see ::drupalUserIsLoggedIn()
     $account->sessionId = $this->getSession()->getCookie(\Drupal::service('session_configuration')->getOptions(\Drupal::request())['name']);
diff --git a/core/tests/Drupal/Tests/UiHelperTrait.php b/core/tests/Drupal/Tests/UiHelperTrait.php
index 098a9864f6..b034226133 100644
--- a/core/tests/Drupal/Tests/UiHelperTrait.php
+++ b/core/tests/Drupal/Tests/UiHelperTrait.php
@@ -65,6 +65,10 @@
    *   underscores.
    */
   protected function submitForm(array $edit, $submit, $form_html_id = NULL) {
+    if (is_object($submit)) {
+      @trigger_error('Calling ' . __METHOD__ . '() with $submit as an object is deprecated in drupal:9.2.0 and strings will be required in drupal:10.0.0. Pass a plain string instead. See https://www.drupal.org/node/xxx', E_USER_DEPRECATED);
+    }
+
     $assert_session = $this->assertSession();
 
     // Get the form.
@@ -253,7 +257,7 @@ protected function drupalLogin(AccountInterface $account) {
     $this->submitForm([
       'name' => $account->getAccountName(),
       'pass' => $account->passRaw,
-    ], t('Log in'));
+    ], 'Log in');
 
     // @see ::drupalUserIsLoggedIn()
     $account->sessionId = $this->getSession()->getCookie(\Drupal::service('session_configuration')->getOptions(\Drupal::request())['name']);
