Thanks Sebb: I've set the 'Label' input of a Java Request/JavaTestsampler in the first thread group to:${__setProperty(property,${variable})}This successfully sets the property to the variable value; I can now useit in the second thread group. Is this behaviour of User Defined Variables (in my earlier testplanbelow) worth a bugzilla entry?> 'HTTP Sampler 2' is just a dummy request that appears to 'fix' the> property set in thread 1. If I remove that sampler the propertyappears> as '${some_jmeter_variable}' (instead of the JMeter variable's value)> the second thread group. Thanks & regards,Sonam Chauhan-- Corporate Express Australia Ltd. Phone: +61-2-93350725. Email: sonam chauhan@ce com au-----Original Message-----From: sebb [mailto:sebbaz@gmail com] Sent: Tuesday. 13 November 2007 2:17 PMTo: JMeter Users ListSubject: Re: How can JMeter variables be shared between thread groups?On 13/11/2007. Sonam Chauhan <sonam chauhan@ce com au> wrote:> Hi Sebb:>> > That should work. At the very least the property should be set to> >> > ${some_jmeter_variable }> Yes that's what the string that it evaluates to.>> > BTW is the trailing space present in the test plan?> Sorry for the confusion the trailing space wasn't in the test plan.>>> I was just gonna write to say I tried the 'User Defined Variables'> Config Element instead of the 'User Parameter' Pre-Processor and itgot> it working (along with what appears to be a bug). RE is a Post-Processor and happens after a sample. User Parameters is a Pre-Processor and only happens before a sample.> Here's my test plan:> -------------------------------------> Thread 1 (1 thread)> - HTTP Sampler 1> -- Regex Extractor 1(Initialize some_jmeter_variable)> - User Defined Variables 1 (Set some_property = some_jmeter_variable)> - HTTP Sampler 2 (Dummy Request that uses property set above)You could just use a Java Request with the __setProperty() in one of thefields.> Thread 2 (multiple threads)> - HTTP Sampler 3 (Real request that uses property set above)> ------------------------------------->> This finally does work.>> 'HTTP Sampler 2' is just a dummy request that appears to 'fix' the> property set in thread 1. If I remove that sampler the propertyappears> as '${some_jmeter_variable}' (instead of the JMeter variable's value)> the second thread group.>> Is this a bug? I am using 2.1.1.>> Kind regards,> Sonam Chauhan> --> Corporate Express Australia Ltd.> Phone: +61-2-93350725. Email: sonam chauhan@ce com au>> -----Original Message-----> From: sebb [mailto:sebbaz@gmail com]> Sent: Tuesday. 13 November 2007 1:58 PM> To: JMeter Users List> Subject: Re: How can JMeter variables be shared between thread groups?>> On 13/11/2007. Sonam Chauhan <sonam chauhan@ce com au> wrote:> > Thanks Sebb.> >> > > JMeter properties are gobal. You can use the __setProperty()> function> > > to set a property.> >> > Can I set a property to the value of a JMeter variable? I tried the>> Yes.>> > following in a User Parameter element but it doesn't seem to work(at> > least in 2.1.1):> >> > ${__setProperty(some_property,${some_jmeter_variable })}>> That should work. At the very least the property should be set to>> ${some_jmeter_variable }>> Check jmeter log>> BTW is the trailing space present in the test plan?>> > Is there any other way to exchange run-time data between threads?>> Not without using BeanShell or otherwise writing code.>> Threads are supposed to be independent...>> > Kind regards,>> > Sonam Chauhan> > --> > Corporate Express Australia Ltd.> > Phone: +61-2-93350725. Email: sonam chauhan@ce com au> >> > -----Original Message-----> > From: sebb [mailto:sebbaz@gmail com]> > Sent: Tuesday. 13 November 2007 1:09 PM> > To: JMeter Users List> > Subject: Re: How can JMeter variables be shared between threadgroups?> >> > On 13/11/2007. Sonam Chauhan <sonam chauhan@ce com au> wrote:> > > Can JMeter variables be shared between thread groups?> > >> >> > No; JMeter variables are per-thread.> >> > The initial settings are copied to all threads when the threads are> > created; thereafter the variables are independent. That is essential> > to allow threads to process RE extractors etc independently.> >> > JMeter properties are gobal. You can use the __setProperty()function> > to set a property.> >> > >> > > A regression testcase I am building needs to 'scrape' a variable> from> > a> > > webpage _only once_ then use it the scraped variable in load> testing> > > another webservice. So I built a testcase with 2 thread groupswith> > 'Run> > > each Thread Group separately' ticked in the test plan. The first> > thread> > > group runs just one thread - an HTTP request with a Regular> Expression> > > Extractor that 'scrapes' a webpage to initializes a JMetervariable> > > reference.> > >> > >> > >> > > The second thread has multiple threads using the JMeter variable> > scraped> > > from the first thread group. However. I found the JMeter variableis> > > successfully initialized in the first thread but not passed tothe> > > second thread group. Is that expected behaviour? I am using JMeter> > 2.1.1> > >> > >> > >> > > Kind regards,> > >> > > Sonam Chauhan> > >> > > --> > >> > > Corporate Express Australia Ltd.> > >> > > Phone: +61-2-93350725. Email: sonam chauhan@ce com au> > >> > >> > >> > >> >> >---------------------------------------------------------------------> > 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> >> >>> ---------------------------------------------------------------------> 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>>---------------------------------------------------------------------To unsubscribe e-mail: jmeter-user-unsubscribe@jakarta apache orgFor additional commands e-mail: jmeter-user-help@jakarta apache org---------------------------------------------------------------------To unsubscribe e-mail: jmeter-user-unsubscribe@jakarta apache orgFor additional commands e-mail: jmeter-user-help@jakarta apache org
Forex Groups - Tips on Trading
Related article:
http://mail-archives.apache.org/mod_mbox/jakarta-jmeter-user/200711.mbox/%3CE5D178BFB0356B48A48B8330B290372103715659@syd1exc04.CE.CORP%3E
comments | Add comment | Report as Spam
|