diff --git drupal_web_test_case.php drupal_web_test_case.php
index b525966..8d6120e 100644
--- drupal_web_test_case.php
+++ drupal_web_test_case.php
@@ -1508,8 +1508,12 @@ class DrupalWebTestCase extends DrupalTestCase {
    * @param $headers
    *   An array containing additional HTTP request headers, each formatted as
    *   "name: value".
+   * @param $form_id
+   *   The optional string identifying the form to be submitted. On some pages
+   *   there are many identical forms, so just using the value of the submit
+   *   button is not enough.
    */
-  protected function drupalPost($path, $edit, $submit, array $options = array(), array $headers = array()) {
+  protected function drupalPost($path, $edit, $submit, array $options = array(), array $headers = array(), $form_id = NULL) {
     $submit_matches = FALSE;
     if (isset($path)) {
       $html = $this->drupalGet($path, $options);
@@ -1517,7 +1521,11 @@ class DrupalWebTestCase extends DrupalTestCase {
     if ($this->parse()) {
       $edit_save = $edit;
       // Let's iterate over all the forms.
-      $forms = $this->xpath('//form');
+      $xpath = "//form";
+      if (!empty($form_id)) {
+        $xpath .= "[@id='" . form_clean_id($form_id) . "']";
+      }
+      $forms = $this->xpath($xpath);
       foreach ($forms as $form) {
         // We try to set the fields of this form as specified in $edit.
         $edit = $edit_save;
