[Grinder-use] Dynamically changing the content of HTTPRequest defaultdata
Distributed load testing framework - Java, Jython, or Clojure scripts.
Brought to you by:
philipa
|
From: Antonio O. <ant...@sc...> - 2013-09-26 18:48:47
|
Hi,
I'm load testing a web api call used to import data into my application, I
used the proxy recorder to record my session and it generated the following
call (slightly edited)
request3 = createRequest(Test(203, 'POST importWeb'), url0)
request3.setDataFromFile('http-data-0.dat')
result = request3.POST('/importWeb',
request3.getData(),
(NVPair('Content-Type', 'multipart/form-data'), ))
and created the file "http-data-0,dat" with contents:
-----------------------------1705984948108958842379964678
> Content-Disposition: form-data; name="report_id"
>
> 865
> -----------------------------1705984948108958842379964678
> Content-Disposition: form-data; name="compounds"; filename="ideas.sdf"
> Content-Type: application/vnd.stardivision.math
>
> 21335604.finalpose
> Canvas 00000000002D
>
> 34 39 0 0 0 0 0 0 0 0999 V2000
> -6.8315 4.6621 0.0000 O 0 0 0
> -6.8315 3.3621 0.0000 C 0 0 0
> -7.9573 2.7121 0.0000 N 0 0 0
> -7.9573 1.4121 0.0000 C 0 0 0
> -6.8315 0.7621 0.0000 C 0 0 0
> -5.7057 1.4121 0.0000 C 0 0 0
> -4.5798 0.7621 0.0000 C 0 0 0
> -3.4540 1.4121 0.0000 C 0 0 0
>
>
When running load tests the report_id that this data is supposed to be
loaded to will change everytime, but the proxy recorder has hardcoded it in
the http-data-0.dat file. How can I modify it during runtime?
Regards,
Antonio
|