jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Dynamic naming of files in HTTP Request
Date Thu, 20 Jan 2011 15:34:06 GMT
On 20 January 2011 15:26, Dan Heitbohmer <dan@conceptual.ca> 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:
> java.io.FileNotFoundException:
> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\'${'test_user'}'_POST3771789563464406421.binary

See:

http://jakarta.apache.org/jmeter/usermanual/functions.html#functions

"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 java.io.FileInputStream.open(Native Method)
>    at java.io.FileInputStream.<init>(Unknown Source)
>    at java.io.FileInputStream.<init>(Unknown Source)
>    at
> org.apache.jmeter.protocol.http.sampler.PostWriter.writeFileToStream(PostWriter.java:406)
>    at
> org.apache.jmeter.protocol.http.sampler.PostWriter.sendPostData(PostWriter.java:143)
>    at
> org.apache.jmeter.protocol.http.sampler.HTTPSampler.sendPostData(HTTPSampler.java:122)
>    at
> org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:508)
>    at
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:965)
>    at
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:951)
>    at
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:348)
>    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243)
>    at java.lang.Thread.run(Unknown 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: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message