jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: reg beanshell preprocessor
Date Wed, 03 Feb 2010 16:45:20 GMT
http://www.beanshell.org/ + Java documentation

On Wed, Feb 3, 2010 at 2:21 AM, sudheer reddy <gsudheer.08@gmail.com> wrote:

> Thankyou Haikal  for your support and it is working
>
> can you tell where i can find more information about this beanshell
> scripting
>
> Thanks & Regards
>
> On Wed, Feb 3, 2010 at 11:44 AM, Haikal <haikal00@gmail.com> wrote:
>
> > Try replace comparison operator == with comparison function equals()
> > before:
> > > if (vars.get("AC") == YES)
> > after:
> > > if ("YES".equals(vars.get("AC")))
> >
> > The operator == compare object reference, not the contents of the string.
> >
> > ~haikal
> >
> > On Wed, Feb 3, 2010 at 12:55 PM, sudheer reddy <gsudheer.08@gmail.com>
> > wrote:
> > > Hi All
> > >
> > > I am facing a problem while using the bean shell preprocessor .
> > >
> > > I have a scenario  where i extract a value from a http request using
> the
> > > xpath extractor and am using the the same value
> > >
> > > as condition for if else statement in bean shell preprocessor. and i
> have
> > > written the if else condition in bean shell preprocessor .
> > >
> > >
> > > below is my test plan
> > >
> > > thread group
> > >
> > >   |--http request
> > >
> > >      |_ xpath extractor ( extracting the value for attribute AC  AC =
> > YES)
> > >
> > >   |--http request       ( AC and App are attributes in this http rquest
> > > using AC=YES/NO condition i have to assign the value for App)
> > >
> > >      |_ BeanShell PreProcessor
> > >
> > > below is my script for beanshell
> > >
> > > if (vars.get("AC") == YES)
> > > {
> > > vars.put( "App", "null" );
> > > print(vars.get("App"));
> > > }
> > > else
> > > {
> > > vars.put( "App", "P2SGPAppEng01" );
> > > print(vars.get("App"));
> > > }
> > >
> > > PLs assist me in solving this
> > >
> > > Thanks & rgds
> > >
> > > Sudheer
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>

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