Re: [Grinder-use] grinder support for file upload
James Liang <[email protected]> Wed, 30 Nov 2011 15:47:04 -0500
| Newsgroups | gmane.comp.java.grinder.devel,gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <66360B3D135282408759C4D50104FB326B0C0DA488@mercury.utopiasystems.net> |
Grinder proxy support for file upload appears broken in grinder-3.6.
Using wireshark, I verified the test server I am uploading a file (contains a bunch of 'A') is following rfc 1867 http file upload spec.
However, the generated the proxy generated py script did not contain any of the file data. I was expecting the multipart submit to be part of the generated script.
def page1(self):
"""POST appfile.seam (request 101)."""
result = request101.POST('/oflows/oconsole/appfile.seam',
'AJAXREQUEST=_viewRoot&docupload=docupload&docupload%3Aupload%3Afile=test.jpg&docupload%3Aupload%3Afile=&javax.faces.ViewState=j_id4&docupload%3Aupload=docupload%3Aupload&ajaxSingle=docupload%3Aupload&_richfaces_upload_uid=0.7842636289930416&_richfaces_file_upload_action=progress&AJAX%3AEVENTS_COUNT=1&',
( NVPair('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'), ))
self.token_javaxfacesViewState = \
httpUtilities.valueFromHiddenInput('javax.faces.ViewState') # 'j_id4'
return result
Wireshark shows the http traffic (formating slightly off) is this:
POST /oflows/oconsole/appfile.seam?_richfaces_upload_uid=0.915415757787077&docupload:upload=docupload:upload&_richfaces_upload_file_indicator=true&AJAXREQUEST=_viewRoot HTTP/1.1
Host: provident.console.oflows.us
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://provident.console.oflows.us/oflows/oconsole/appfile.seam?appId=3&cid=256&conversationPropagation=join
Cookie: JSESSIONID=62F66A70B99AA9F611807904B20049E6
Content-Type: multipart/form-data; boundary=---------------------------491299511942
Content-Length: 19393
-----------------------------491299511942
Content-Disposition: form-data; name="docupload"
docupload
-----------------------------491299511942
Content-Disposition: form-data; name="docupload:upload:file"; filename="test.jpg"
Content-Type: image/jpeg
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
....
[more stuff]
Thanks,
James Liang
From: Carlos E. Torchia [mailto:ctorchia-a84/LA3/[email protected]]
Sent: Tuesday, November 29, 2011 9:28 PM
To: grinder-use
Subject: Re: [Grinder-use] grinder support for file upload
I am on Grinder 3.5. Have you tried recording an upload of a file to a different site? Is it possible your web app is doing fancy stuff with JavaScript and not really sending the file as form data, but encoding and sending it in separate requests?
On Tue, Nov 29, 2011 at 11:57 PM, James Liang <[email protected]<mailto:[email protected]>> wrote:
Thanks Carlos.
I am surprise this worked for you. I've did a capture and I can see the POST request in the generated script. However, the data from file is not there. There is no multi part form data in the generated py script.
What version of Grinder are you using? I am on grinder-3.6.
Thanks,
James Liang
From: Carlos E. Torchia [mailto:ctorchia-a84/LA3/[email protected]<mailto:ctorchia-a84/LA3/[email protected]>]
Sent: Tuesday, November 29, 2011 8:24 PM
To: grinder-use
Subject: Re: [Grinder-use] grinder support for file upload
I recorded a test that involves a file upload. It's just multi-part form data, with the data of the file and the entire POST request represented as a string in the Jython code.
E.g. suppose you have a file with HELLO_WORLD in it. Then the proxy server would record something like:
request1234.POST('/hello-world', '<bunchastuff>HELLO_WORLD<bunchastuff>')
hope this helps
On Tue, Nov 29, 2011 at 6:32 PM, James Liang <[email protected]<mailto:[email protected]>> wrote:
Hi all,
Does the grinder proxy tool support the capturing of file uploads? I need to load test a file upload function of the system. Any advice on using grinder for this purpose?
Thanks,
James Liang
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
grinder-use mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/grinder-use
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
grinder-use mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/grinder-use
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Grinder-development mailing list
Grinder-development-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/grinder-development