On 6 November 2012 06:49, Philippe Mouawad <[email protected]> wrote:
> Use case is the following.
> A search screen with auto complete feature that triggers on first 3 letters
> then on next type.
>
> So I use a csv for words to search and I need substring to simulate
> typeahead/autocomplete calls.

If I were doing that test I'd probably put the substring in the CSV
file - cheaper to do it before the test.

> Note that I succeed doing it with beanshell preprocessor but I find it a
> bit too hard for just that and not great for performances.

It's quite easy to set up BeanShell functions in a startup script
which should improve performance.

I.e. define the property:

beanshell.function.init=BeanShellFunction.bshrc

and create the function:

String substring(str,beg,end) {
  return s.substring(str,beg,end);
}

I'm not saying we should not add more functions, but we need to be
careful not to add lots of special-purpose functions that are rarely
used but still require testing, maintaining and documenting. Also the
user has to read more documentation.

> Regards
> Philippe
>
> On Tuesday, November 6, 2012, sebb wrote:
>
>> On 5 November 2012 20:08, Philippe Mouawad 
>> <[email protected]<javascript:;>>
>> wrote:
>> > Hello,
>> > I am working currently on a test where I need substring function.
>> > I see it seems to require either javascript or beanshell, wouldn't it be
>> > useful to have a jmeter function ?
>> >
>> > If you are ok, i will implement it and raise a bugzilla.
>>
>> Is your use case generally applicable?
>>
>> If so, then OK, otherwise it is just bloat.
>>
>> > Regards
>> > Philippe
>> >
>> >
>> > --
>> > Cordialement.
>> > Philippe Mouawad.
>>
>
>
> --
> Cordialement.
> Philippe Mouawad.

Reply via email to