=== modified file 'modules/simpletest/drupal_web_test_case.php'
--- modules/simpletest/drupal_web_test_case.php	2010-02-10 08:21:05 +0000
+++ modules/simpletest/drupal_web_test_case.php	2010-02-10 08:28:20 +0000
@@ -1456,6 +1456,9 @@
    */
   protected function drupalGet($path, array $options = array(), array $headers = array()) {
     $options['absolute'] = TRUE;
+    
+    // cURL will handle links with a fragment incorrectly.
+    $options['fragment'] = NULL;
 
     // We re-using a CURL connection here. If that connection still has certain
     // options set, it might change the GET into a POST. Make sure we clear out
@@ -1959,19 +1962,69 @@
 
     if (isset($urls[$index])) {
       $url_target = $this->getAbsoluteUrl($urls[$index]['href']);
+      
+      // Parse the relevant URL parts out so we can call drupalGet properly.
+      $p = parse_url($url_target);
+      $p += array(
+        'user' => NULL,
+        'port' => NULL,
+        'query' => NULL,
+        'fragment' => NULL,
+      );
+      // Break the query string into an associative array.
+      if ($p['query']) {
+         $params = explode('&', $p['query']);
+         $p['query'] = array();
+         foreach ($params as $param) {
+           $kv = explode("=", $param);
+           $p['query'][$kv[0]] = count($kv) > 1 ? $kv[1] : NULL; 
+         }
+      }
+      
+      $url_target = self::buildURL($p);
     }
-
+    
     $this->assertTrue(isset($urls[$index]), t('Clicked link %label (@url_target) from @url_before', array('%label' => $label, '@url_target' => $url_target, '@url_before' => $url_before)), t('Browser'));
 
     if (isset($url_target)) {
-      // CURL breaks in drupalGet() if the URL contains a fragment.
-      // @todo remove when http://drupal.org/node/671520 is fixed.
-      // Strips off any fragment from the path.
-      $url_target = array_shift(explode('#', $url_target));
-      return $this->drupalGet($url_target);
+      return $this->drupalGet($url_target, array(
+        'query' => $p['query'],
+        'fragment' => $p['fragment'],
+      ));
     }
     return FALSE;
   }
+  
+  /**
+   * Internal helper function. Help build a link from parsed URL information,
+   * without including the query or fragment links.
+   * 
+   * @param $parsed
+   *   The parsed URL info.
+   * @return
+   *   The built URL, without the query/fragment parts.
+   */
+  static protected function buildURL($parsed) {
+    $url = $parsed['scheme'] . '://';
+    
+    // Include user/pass info if necessary.
+    if ($parsed['user']) {
+      $url .= $parsed['user'];
+      if ($parsed['pass']) {
+        $url .= ':' . $parsed['pass'];
+      }
+      $url .= '@';
+    }
+      
+    $url .= $parsed['host'];
+    
+    // Include port info if necessary.
+    if ($parsed['port']) $url .= ':' . $parsed['port'];
+    
+    $url .= $parsed['path'];
+    
+    return $url;
+  }
 
   /**
    * Takes a path and returns an absolute path.

