diff -u b/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php --- b/core/lib/Drupal/Core/Form/FormBuilder.php +++ b/core/lib/Drupal/Core/Form/FormBuilder.php @@ -790,6 +790,7 @@ '#type' => 'hidden', '#value' => $form_id, '#id' => Html::getUniqueId("edit-$form_id"), + '#attributes' => ['data-drupal-selector' => Html::getId("edit-$form_id")], // Form processing and validation requires this value, so ensure the // submitted form value appears literally, regardless of custom #tree // and #parents being set elsewhere.