1
votes

I am trying to run the jmeter test-suites in eclipse.
In my test-suite I am using a BeanShellAssertion to count the number of rows in a csv file.
I have a custom jmeter function to do so.
The script of the BeanShellAssertion is :

String str = "${__CustomFunction("Path to the CSV file")}";
int i = Integer.parseInt(str);
if(i ==0)
{
   Failure = true;
   FailureMessage = "Failed!";
}
return i;

This test-suite works fine when I run it using the jmeter on my local machine.
Only when I try to run it with eclipse, (using the jmeter maven plugin) I see the following error:

jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: `` String str = "${__CustomFunction("FilePath")}"; int i = Integ . . . '' : Typed variable declaration : Method Invocation Integer.parseInt

I am wondering if there's some other way to invoke the jmeter functions when executing it using eclipse cause I am sure that the function is correct as I mentioned before that it works fine when the test suite is run using the jmeter on my local machine.

Any help would be appreciated. Thanks.

1
Any news on that, was my answer ok, if yes you should accept it, if not please comment.UBIK LOAD PACK

1 Answers

1
votes

Are you sure your custom function jar is visible for the Maven Plugin ?

As when you run it from JMeter, it works , I suppose you have a jar in lib/ext.

So you need to make this jar available to the jmeter maven plugin.