Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 87938 invoked from network); 20 Jan 2011 18:31:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jan 2011 18:31:39 -0000 Received: (qmail 63692 invoked by uid 500); 20 Jan 2011 18:31:38 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 63675 invoked by uid 500); 20 Jan 2011 18:31:36 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list jmeter-user@jakarta.apache.org Received: (qmail 63662 invoked by uid 99); 20 Jan 2011 18:31:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jan 2011 18:31:35 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,URIBL_JP_SURBL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.216.44 as permitted sender) Received: from [209.85.216.44] (HELO mail-qw0-f44.google.com) (209.85.216.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jan 2011 18:31:30 +0000 Received: by qwi2 with SMTP id 2so951438qwi.31 for ; Thu, 20 Jan 2011 10:31:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=mmVezTAxW4CrmywM4MKM/YrPNA85F2r95FiMW5cm1tQ=; b=Bn9luVav3KQogLOAzZlPytNpKJz8E1xE5scrAyi+1qq7E5Xq5cfWTFCLoJ5IChtxEV sSpwc9V2lGrXDtM1AkEWeLwHrkFKnkgIPM2NK2b9nOXKgHCcEjauoKeaa27/sv7rzCJU 0mge3yNFzgS0pENe/E3gHQ5YnKcwsbpuhpSsk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=EaOO24FRu72/mxx/aoqPwWIl+8yu3PL6Oh45/RUoPpUWLA1dIVtzIvNjB0ONcO9mhp lnA+4Q592r+OQI8NBIOD/SULPHaiuYAjvDOjBaekoapvXdUGbxh0zt/d9sgukV0KGuxA DxmMTK2eqEscero/fcLDWbRG5yOMKRby/LAF4= MIME-Version: 1.0 Received: by 10.229.70.130 with SMTP id d2mr1950412qcj.218.1295548269362; Thu, 20 Jan 2011 10:31:09 -0800 (PST) Received: by 10.229.95.208 with HTTP; Thu, 20 Jan 2011 10:31:09 -0800 (PST) In-Reply-To: <4D386277.9040702@conceptual.ca> References: <4D38540F.10204@conceptual.ca> <4D386277.9040702@conceptual.ca> Date: Thu, 20 Jan 2011 18:31:09 +0000 Message-ID: Subject: Re: Dynamic naming of files in HTTP Request From: sebb To: JMeter Users List , dan@conceptual.ca Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 20 January 2011 16:27, Dan Heitbohmer wrote: > 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 tr= ee > view it outputs the variables as set: > > JMeterVariables: > JMeterThread.last_sample_ok=3Dtrue > JMeterThread.pack=3Dorg.apache.jmeter.threads.SamplePackage@1153ad1 > START.HMS=3D012016 > START.MS=3D1295504416996 > START.YMD=3D20110120 > TESTSTART.MS=3D1295539900817 > __test_user=3Ddummyuser1@dummy.com > test_user=3Ddummyuser1@dummy.com So only references to ${__test_user} and ${test_user} will resolve. > > 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? Depends where the variable is set, but even so, it should still be picked up by the HTTP sampler. There was a bug relating to this: https://issues.apache.org/bugzilla/show_bug.cgi?id=3D46901 but that was fixed in 2.4 To try and track this down: Try setting the variable on the Test Plan itself. When this is working, you can try setting the variable later in the test pl= an. > 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, > > Dan > > > > On 1/20/2011 10:34 AM, sebb wrote: >> >> On 20 January 2011 15:26, Dan Heitbohmer =A0wrote: >>> >>> 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 dat= a >>> needs to be simulated via unique AMF requests. >>> >>> I have used Zend AMF to decode the recorded responses and re-encoded th= em >>> 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_P= OST5923361474048999554.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}_POST59233= 61474048999554.binary >>> >>> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\'${'test_user'}'_POST5= 923361474048999554.binary >>> >>> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\${__test_user}_POST592= 3361474048999554.binary >>> >>> C:\Users\heikie\Downloads\jakarta-jmeter-2.4\bin\'${'__test_user'}'_POS= T5923361474048999554.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'}'_POST3= 771789563464406421.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) >>> =A0 =A0at java.io.FileInputStream.open(Native Method) >>> =A0 =A0at java.io.FileInputStream.(Unknown Source) >>> =A0 =A0at java.io.FileInputStream.(Unknown Source) >>> =A0 =A0at >>> >>> org.apache.jmeter.protocol.http.sampler.PostWriter.writeFileToStream(Po= stWriter.java:406) >>> =A0 =A0at >>> >>> org.apache.jmeter.protocol.http.sampler.PostWriter.sendPostData(PostWri= ter.java:143) >>> =A0 =A0at >>> >>> org.apache.jmeter.protocol.http.sampler.HTTPSampler.sendPostData(HTTPSa= mpler.java:122) >>> =A0 =A0at >>> >>> org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.= java:508) >>> =A0 =A0at >>> >>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamp= lerBase.java:965) >>> =A0 =A0at >>> >>> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamp= lerBase.java:951) >>> =A0 =A0at >>> >>> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.jav= a:348) >>> =A0 =A0at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:= 243) >>> =A0 =A0at 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 >> >> > > > -- > Dan Heitbohmer > Conceptual Pathways Inc. > 519.273.3377 > dan@conceptual.ca > > > --------------------------------------------------------------------- > 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