Thanks for your explanation of this Sebb, very insightful!
Sounds like a bit of work to make a native function, and to be honest
${__BeanShell(functionName())} would suit my needs perfectly.
Regards,
Noel
----- Original Message -----
From: "sebb" <[email protected]>
To: "JMeter Users List" <[email protected]>
Sent: Thursday, 21 May, 2009 18:56:24 GMT +00:00 GMT Britain, Ireland, Portugal
Subject: Re: User Defined Beanshell Function
On 21/05/2009, Noel O'Brien <[email protected]> wrote:
> Hi All,
>
> Is it possible to define a beanshell function that I can use throughout my
> test in the same way as the built in functions, e.g. instead of using
> ${__threadNum()}
> I can use ${__encrypt("raw string")} ?
You can define a Beanhell function in an init file such as
BeanShellFunction.bshrc,
but this will need to be invoked using __BeanShell(functionName())
It's not possible to register the BeanShell function as a "native" function.
However, you can of course create your own function, just make sure it
implements org.apache.jmeter.functions.Function
The package name must contain ".functions." but not ".gui." - see
jmeter.properties "classfinder.functions" for details.
The code would need to be put in a jar and stored in lib/ext.
> --
> Regards,
>
> Noel
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
Regards,
Noel