Just do it ;-)
For example:
${__BeanShell(source("BeanShellFunction.bshrc");getprop("myprop"\,"default"))}
This sources the file, and then executes the method defined in the file.
Note that errors will not be shown on the GUI - check the log file if
it does not seem to work.
Remember that commas in the script must be escaped with \ - as shown above.
On 22/09/2007, dasarih <[EMAIL PROTECTED]> wrote:
>
> I am very new to beanshell. Say if i have several custom beanshell scripts
> sript1.bsh,script2.bsh etc and each has several methods like script1_mthd1,
> script1_mthd2, script2_mthd1 etc. How can I source a specific script and
> execute a specific method in it, if I do not like to modify the file defined
> by "beanshell.function.init".
>
>
> sebb-2 wrote:
> >
> > On 02/03/07, Ramesh Jaganathan <[EMAIL PROTECTED]> wrote:
> >> It looks like we could have a script and call it as mentioned below in
> >> the
> >> users manual to populate fileds.
> >>
> >> ${__BeanShell(source("function.bsh"))} - processes the
> >> script
> >> in function.bsh
> >
> > Yes - or you can put the method in a file and define the property
> >
> > beanshell.function.init
> >
> > You can then call the method as follows:
> >
> > ${__BeanShell(myMethod(params))}
> >
> >> It means the script gets executed right?
> >
> > Yes.
> >
> >> Should the script's last statement be a return statement ?
> >
> > Yes, the value of the __BeanShell function is the whatever was
> > returned by the sctipr.
> >
> >> I could not get this working. Any ideas?
> >>
> >> Also can we somehow execute a beanshell script which takes parameters in
> >> this context to populate the fields?
> >
> > See above
> >
> >> Thanks,
> >> Ramesh
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/passing-parameters-to-the-beanshell-method-when-using-__BeanShell-tf3331977.html#a12835857
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]