我试图在eclipse中运行jmeter测试套件。
在我的测试套件中,我使用BeanShellAssertion来计算csv文件中的行数。
我有一个自定义jmeter函数来这样做。
的BeanShellAssertion的脚本是:从BeanShell声明脚本调用Jmeter函数
String str = "${__CustomFunction("Path to the CSV file")}";
int i = Integer.parseInt(str);
if(i ==0)
{
Failure = true;
FailureMessage = "Failed!";
}
return i;
该测试套件工作正常,当我用我的本地机器上的JMeter的运行它。
只有当我尝试用eclipse运行它,(使用JMeter的Maven插件),我看到了以下错误:
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
我想知道如果使用eclipse执行时,它还有一些其他的方式来调用JMeter的功能因为我确信这个函数是正确的,正如我之前提到的那样,当我的本地机器上使用Jmeter运行测试套件时,它可以正常工作。
任何帮助,将不胜感激。 谢谢。
关于这一点的任何消息,我的回答是好的,如果是的话,你应该接受它,如果没有请评论。 –