问题描述
我需要10个职位的日期,但是当我调用上面的函数时。
得到错误:
2020-08-13 12:10:12,460 ERROR o.a.j.p.j.s.JSR223Sampler: Problem in JSR223 script JSR223 Sampler,message: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: java.lang.Integer.call() is applicable for argument types: (java.lang.Integer) values: [813121012]
Possible solutions: wait(),any(),abs(),wait(long),wait(long,int),max(int,int)
javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: java.lang.Integer.call() is applicable for argument types: (java.lang.Integer) values: [813121012]
Possible solutions: wait(),int)
解决方法
不要将JMeter Functions or Variables内联到Groovy脚本中,您有2个选择:
-
要么使用JSR223测试元素的“参数”标签,要么
-
或者用于生成日期purely in Groovy,例如:
vars.put('variable',new Date().format('MddHHmmss'))