Sorry I think I wasnt clear. You had two options

a. Use __Beanshell. So you'd write a script that calls your function which
does a return getChannelList() or whatever value you want returned and then
use ${__BeanShell(source("yourscript.bsh"))} to get this value , (You
wouldnt need the beanshell sampler)

OR

b. Continue using your beanshell sampler, however instead of returning the
vaue, in the bean shell script do something like
vars.put("result",getChannelList());
and in your test use ${result}

regards
deepak

On Tue, Jul 21, 2009 at 12:32 AM, annie35 <[email protected]> wrote:

>
> Thank you for your answer,
> You mean when I call the beanshell function like this :
> ${__getChannelList(vars.get("${myparam}"))};  ?
>
>  if I put this call directly in the script field of the BeanShell Sampler
> it
> doesn't work also when I create a post or a pre beanshell.
>
> Where can I call the BeanShell ? and how ?
>
> annie35
>
>
>
> Deepak Shetty wrote:
> >
> > hi
> > I dont think you can do what you want directly
> > The returned value is used when you call the BeanShell function using ${*
> > __BeanShell*(...)}
> > If you want a value stored into the variable use vars.put("name",value)
> > in
> > your function instead of using the return value.
> > regards
> > deepak
> > .
> >
> >
> >
> > On Mon, Jul 20, 2009 at 9:18 AM, annie35  wrote:
> >
> >>
> >> Hi,
> >>
> >> 1- I create an external beanShell which taken a string in param and
> >> return
> >> a
> >> string :
> >>
> >> getChannelList(String sChannelName){
> >> return sChannelName;}
> >>
> >> 2- I create a BeanShell Sampler with in parameters field: ${myParam} and
> >> in
> >> the script file field : scripts/getChannelList.bsh
> >>
> >> my BSH is recognied, because I don't have any error, but how can I do to
> >> get
> >> the return string value ?
> >>
> >> thanks to help me
> >> annie35
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/-JMeter--BeanShell-Sampler-using-a-script-file-tp24572864p24572864.html
> >> Sent from the JMeter - User mailing list archive at Nabble.com.
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-JMeter--BeanShell-Sampler-using-a-script-file-tp24572864p24582915.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>

Reply via email to