jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grigoryan, Lilit" <lilit.grigor...@lycos-europe.com>
Subject RE: function within variable
Date Tue, 12 Jul 2005 09:46:57 GMT
Even so I downloaded the jar, I cant get it working.
The log file says 

2005/07/12 14:44:06 WARN  - jmeter.functions.BeanShell:
java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at
org.apache.jmeter.functions.BeanShell.execute(BeanShell.java:107)
	at
org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
java:150)
	at
org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
java:113)
	at
org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(F
unctionProperty.java:99)
	at
org.apache.jmeter.testelement.AbstractTestElement.getPropertyAsString(Ab
stractTestElement.java:234)
	at
org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.getQuery(JDBCSampler
.java:260)
	at
org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.toString(JDBCSampler
.java:266)
	at
org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.j
ava:82)
	at
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254)
	at java.lang.Thread.run(Thread.java:534)
Caused by: Sourced file: inline evaluation of:
``vars.get("componentID1");'' : Attempt to resolve method: get() on
undefined variable or class name: vars : at Line: 1 : in file: inline
evaluation of: ``vars.get("componentID1");'' : vars .get (
"componentID1" ) 

	at bsh.UtilEvalError.toEvalError(Unknown Source)
	at bsh.UtilEvalError.toEvalError(Unknown Source)
	at bsh.BSHMethodInvocation.eval(Unknown Source)
	at bsh.BSHPrimaryExpression.eval(Unknown Source)
	at bsh.BSHPrimaryExpression.eval(Unknown Source)
	at bsh.Interpreter.eval(Unknown Source)
	at bsh.Interpreter.eval(Unknown Source)
	at bsh.Interpreter.eval(Unknown Source)

I looked in the manual, but I could not find anything about vars. 

Thanks,
Lilit

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Monday, July 11, 2005 5:54 PM
To: JMeter Users List
Subject: Re: function within variable

If something does not work, always check in jmeter.log for error
messages.

BeanShell is optional, so you need to download the jar from
www.beanshell.org and put it in the lib directory before you can use
it.

I meant that someone could create a new function to evaluate its
parameter as a variable - which is what the BeanShell script is
currently doing.

S.
On 7/11/05, Grigoryan, Lilit <lilit.grigoryan@lycos-europe.com> wrote:
> Hi Sebb,
> 
> Thank you very much for the clarification.
> I've tried ${__BeanShell(vars.get("${VAR1}${VAR2}"))}, where
> VAR1=componentID and VAR2=1, but the function doesn't return anything.
> 
> Please, clarify what you mean by creating var() function.
> 
> Thanks,
> Lilit
> 
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Monday, July 11, 2005 4:22 PM
> To: JMeter Users List
> Subject: Re: function within variable
> 
> Nested variables don't seem to work.
> 
> However, variables nested inside function calls do work.
> For example:
> 
> Set variables:
> VAR1=abc
> VAR2=def
> abcdef=xyz
> 
> and then the following gives:
> 
> ${__BeanShell(vars.get("${VAR1}${VAR2}"))}
> 
> xyz
> 
> If it's not easy / desirable to fix nested variables, it should be
> easy to create a var() function that does the same as the BeanShell
> script above (with less typing and overhead).
> 
> S.
> On 7/11/05, Darko Jovisic <Darko.Jovisic@cern.ch> wrote:
> > I'm also having the same problem when iterating foreach. I have more
> > regexs and i want to iterate through all of them at the same time so
I
> > use:
> >
> > ${status_g${__counter(FALSE,C)}}
> >
> > and I get:
> >
> > status=${FALSE,C)}}
> >
> > Cheers,
> > Darko
> >
> > -----Original Message-----
> > From: Grigoryan, Lilit [mailto:lilit.grigoryan@lycos-europe.com]
> > Sent: Monday, July 11, 2005 9:29 AM
> > To: jmeter-user@jakarta.apache.org
> > Subject: function within variable
> >
> > Hi,
> >
> >
> >
> > I am trying to insert a number into a variable by using the
following
> > expression ${componentID${__counter(false,counter)}}, but I am
getting
> > ${false,counter)}} instead of ${componentID1}.
> >
> > Please, advise.
> >
> >
> >
> > Thanks,
> >
> > Lilit
> >
> >
> >
---------------------------------------------------------------------
> > 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.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message