Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.110
diff -u -p -r1.110 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	30 May 2009 11:17:32 -0000	1.110
+++ modules/simpletest/drupal_web_test_case.php	31 May 2009 14:15:01 -0000
@@ -1322,13 +1322,16 @@ class DrupalWebTestCase extends DrupalTe
    *   $edit['name[]'] = array('value1', 'value2');
    * @param $submit
    *   Value of the submit button.
+   * @param $form_id
+   *   The form id of the form to submit.  If not set, then first matching form
+   *   will be used.
    * @param $options
    *   Options to be forwarded to url().
    * @param $headers
    *   An array containing additional HTTP request headers, each formatted as
    *   "name: value".
    */
-  protected function drupalPost($path, $edit, $submit, array $options = array(), array $headers = array()) {
+  protected function drupalPost($path, $edit, $submit, $form_id = NULL, array $options = array(), array $headers = array()) {
     $submit_matches = FALSE;
     if (isset($path)) {
       $html = $this->drupalGet($path, $options);
@@ -1338,6 +1341,11 @@ class DrupalWebTestCase extends DrupalTe
       // Let's iterate over all the forms.
       $forms = $this->xpath('//form');
       foreach ($forms as $form) {
+        // If looking for a specific form and the form ids don't match, move
+        // onto the next form.
+        if (isset($form_id) && $form_id != $form['id']) {
+          continue;
+        }
         // We try to set the fields of this form as specified in $edit.
         $edit = $edit_save;
         $post = array();
Index: modules/simpletest/tests/form.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v
retrieving revision 1.12
diff -u -p -r1.12 form.test
--- modules/simpletest/tests/form.test	25 May 2009 05:20:16 -0000	1.12
+++ modules/simpletest/tests/form.test	31 May 2009 14:15:01 -0000
@@ -430,10 +430,10 @@ class FormsFormStorageTestCase extends D
     $user = $this->drupalCreateUser(array('access content'));
     $this->drupalLogin($user);
 
-    $this->drupalPost('form_test/form-storage', array('title' => 'new', 'value' => 'value_is_set'), 'Continue', array('query' => 'cache=1'));
+    $this->drupalPost('form_test/form-storage', array('title' => 'new', 'value' => 'value_is_set'), 'Continue', NULL, array('query' => 'cache=1'));
     $this->assertText('Form constructions: 1', t('The form has been constructed one time till now.'));
 
-    $this->drupalPost(NULL, array(), 'Save', array('query' => 'cache=1'));
+    $this->drupalPost(NULL, array(), 'Save', NULL, array('query' => 'cache=1'));
     $this->assertText('Form constructions: 2', t('The form has been constructed two times till now.'));
     $this->assertText('Title: new', t('The form storage has stored the values.'));
   }
Index: modules/translation/translation.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.test,v
retrieving revision 1.11
diff -u -p -r1.11 translation.test
--- modules/translation/translation.test	2 Apr 2009 20:39:45 -0000	1.11
+++ modules/translation/translation.test	31 May 2009 14:15:02 -0000
@@ -61,7 +61,7 @@ class TranslationTestCase extends Drupal
     $edit = array();
     $edit['title'] = $this->randomName();
     $edit['body'] = $this->randomName();
-    $this->drupalPost('node/add/page', $edit, t('Save'), array('query' => array('translation' => $node->nid, 'language' => 'es')));
+    $this->drupalPost('node/add/page', $edit, t('Save'), NULL, array('query' => array('translation' => $node->nid, 'language' => 'es')));
     $duplicate = $this->drupalGetNodeByTitle($edit['title']);
     $this->assertEqual($duplicate->tnid, 0, t('The node does not have a tnid.'));
 
