[ grinder-Bugs-3515184 ] generated script mishandles multi-valued request parameters

SourceForge.net <[email protected]> Thu, 05 Apr 2012 06:17:35 -0700
Newsgroups gmane.comp.java.grinder.devel
Message-ID <[email protected]>
Bugs item #3515184, was opened at 2012-04-05 06:17
Message generated for change (Tracker Item Submitted) made by 
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3515184&group_id=18598

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: TCPProxy
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bill Smith ()
Assigned to: Nobody/Anonymous (nobody)
Summary: generated script mishandles multi-valued request parameters

Initial Comment:
My app has a form post with a multi-valued parameter  The generated Clojure script erroneously uses the same value for all instances of the parameter.  See for example the references to token_login2 in the script fragment below:

; Worker thread state is stored in a map using a dynamic var.
(def ^:dynamic *tokens*)
(defn set-token [k v] (set! *tokens* (assoc *tokens* k v)))
(defn token [k] (*tokens* k))

[...]

(defpage page4 "POST login (requests 401-408)." (Test. 400 "Page 4") []
  (set-token :token_login2 "Login")
  (set-token :token_login2 "")
  (set-token :token__sourcePage "HQduFOCJZk6Fw7gPHLMv3_9ey7vdLQ8IuRf--7h2p03EenTfDNNtuw==")
  (set-token :token___fp "RbQxcD5ZA1A=")
  
  ; Expecting 302 'Found'
  (.POST request401 "/t/a/login"
    (nvpairs [
      "__session_id__" (token :token___session_id__)
      "operator.password", "XXXXXXXX"
      "login2" (token :token_login2)
      "targetURL" (token :token_targetURL)
      "operator.username" (token :token_operatorusername)
      "login2" (token :token_login2)
      "_sourcePage" (token :token__sourcePage)
      "__fp" (token :token___fp)])
    (nvpairs [
      "Content-Type", "application/x-www-form-urlencoded"]))

  (.sleep grinder 12)

In the above example, the body of the form post should contain two values for "login2": the string "Login" and the empty string "".  Instead, both instances will be the empty string.

Observed using the Grinder 3.9 snapshot, Sun Java 1.6.0_26, and Firefox 11.


Philip Aston remarked to me that the generated Jython scripts may also have the same problem.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3515184&group_id=18598

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev