diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test
index 4370f18433daeb1173b9f0428f0279d9eb128a23..6a7f26c3d5ad098255df7816b53695e9e0d0c825 100644
--- a/modules/simpletest/tests/form.test
+++ b/modules/simpletest/tests/form.test
@@ -418,8 +418,8 @@ class FormElementTestCase extends DrupalWebTestCase {
     }
     // Verify that custom #description properties are output.
     foreach (array('checkboxes', 'radios') as $type) {
-      $elements = $this->xpath('//input[@name=:name]/following-sibling::div[@class=:class]', array(
-        ':name' => $type . '[foo]',
+      $elements = $this->xpath('//input[@id=:id]/following-sibling::div[@class=:class]', array(
+        ':id' => 'edit-' . $type . '-foo',
         ':class' => 'description',
       ));
       $this->assertTrue(count($elements), t('Custom %type option description found.', array(