jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: setProperty doesn't work
Date Thu, 08 Nov 2012 05:11:38 GMT
In beanshell use the props object to set a property and follow java rules
for when to quote or not quote a string.

Its likely you are getting syntax errors (And should be in the log)
On Nov 7, 2012 7:50 PM, "frank" <hwl@windowslive.com> wrote:

> using jmeter 2.6, and i have 2 thread groups like next :
>
> -group1
>      |_request1
>              |_beanshell postprocessor1
>      |_request2
> -group2
>      |_request3
>              |_beanshell postprocessor2
>      |_request4
>
> beanshell postprocessor1 like next :
>
> ${__setProperty("rootObjectId", ${rootObjectId})};
> String s = "${bookingNo}";
> if(!s.equals("")){
>
> ${__setProperty(vari1,abc,)};
>
> }else{
>
> ${__setProperty(vari1,,)};
> }
>
> it'll execute 'else' statement
>
> and in request2 , it will use ${__property(vari1,,)} to get the property
> value, and the property value is empty.
>
> for beansehll processor2, its beanshell script is the same as beanshell
> processor1, but now it'll execute 'if' statement, that is i want to set
> value 'abc' for the property
>
> the problem is : in request4, ${__property(vari1,,)} still return empty
> string, but not abc.
>
> and the most confused is : if i add double quote for property name vari1,
> that is in group2, if i changed the beanshell script to :
>
> if(!s.equals("")){
>
> ${__setProperty("vari1",abc,)};
>
> }else{
>
> ${__setProperty("vari1",,)};
> }
>
> ${__property("vari1",,)}
>
> then it works, the ${__property("vari1",,)} of request4 will return abc.
>
> or if i add double quote for property vari1 in group1, but NOT add in
> group2, it also works, in request4, i can get the value abc.
>
> so what's the problem?
> Thanks in advance.
>
>
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/setProperty-doesn-t-work-tp5715260.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message