jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Heitbohmer <>
Subject Re: Dynamic naming of files in HTTP Request
Date Thu, 20 Jan 2011 16:27:35 GMT
Hi Sebb,

Thanks for the fast response.

I inserted a 3000 ms timer after the login JSON data gets read to be 
sure it is set.

 From the Debug Sampler placed directly before the HTTP Request, in the 
tree view it outputs the variables as set:


The file string is in the HTTP Request node in the "Send Files With the 
Request" input box. Variables in the "Send Parameters With the Request" 
(POST) do get set.
Is it possible that the variable only gets set at start of the thread in 
this case?

If so, I can probably set up the files sequenced by a counter, the email 
in the file string would just make tracing a bit easier.

Thanks in advance,


On 1/20/2011 10:34 AM, sebb wrote:
> On 20 January 2011 15:26, Dan Heitbohmer<>  wrote:
>> Hi,
>> This is my first attempt at using JMeter and I have searched for the answer
>> to this for a long while now and I am stuck. Sorry if this is a newbie
>> question.
>> I am using JMeter 2.4 r961953 GUI on windows 7 to simulate a FLEX
>> application interacting with a LAMP server. The login dictates what data
>> needs to be simulated via unique AMF requests.
>> I have used Zend AMF to decode the recorded responses and re-encoded them to
>> created a set of files with the test user email encoded in the filename for
>> each AMF response per user.
>> ie.
>> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\dummyuser1@dummy.com_POST5923361474048999554.binary
>> I have created an auto login script in PHP that returns a JSON response that
>> i can use the variables in JMeter to send data via POST so I am certain that
>> my regular expression is pulling the correct data.
>> So, all that I think I need to do is get the replacer working for the
>> filename string, i tried these:
>> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\${test_user}_POST5923361474048999554.binary
>> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\'${'test_user'}'_POST5923361474048999554.binary
>> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\${__test_user}_POST5923361474048999554.binary
>> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\'${'__test_user'}'_POST5923361474048999554.binary
>> The output from the View Results Tree shows something like this:
>> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\'${'test_user'}'_POST3771789563464406421.binary
> See:
> "If an undefined function or variable is referenced, JMeter does not
> report/log an error - the reference is returned unchanged. For example
> if UNDEF is not defined as a variable, then the value of ${UNDEF} is
> ${UNDEF}."
> So either you are not setting the variable at all, or the variable is
> set after it is needed by the test element.
> Add a Debug Sampler to show what variables you have created.
>> (The system cannot find the file specified)
>>     at Method)
>>     at<init>(Unknown Source)
>>     at<init>(Unknown Source)
>>     at
>> org.apache.jmeter.protocol.http.sampler.PostWriter.writeFileToStream(
>>     at
>> org.apache.jmeter.protocol.http.sampler.PostWriter.sendPostData(
>>     at
>> org.apache.jmeter.protocol.http.sampler.HTTPSampler.sendPostData(
>>     at
>> org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(
>>     at
>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(
>>     at
>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(
>>     at
>> org.apache.jmeter.threads.JMeterThread.process_sampler(
>>     at
>>     at Source)
>> Should the string show the path with the replaced values or the variables?
>> Any advice would be appreciated.
>> Thanks,
>> Dan
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Dan Heitbohmer
Conceptual Pathways Inc.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message