Java 为什么可以';t jmeter解析散列字符?
我Java 为什么可以';t jmeter解析散列字符?,java,groovy,hash,jmeter,character,Java,Groovy,Hash,Jmeter,Character,我 为什么jmeter不能解析散列字符?美元卷曲${}语法将在groovy字符串中使用: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScrptEngineImpl.$() is applicable for argument types: ... Possible solutions: is(j
为什么jmeter不能解析散列字符?美元卷曲
${}
语法将在groovy字符串中使用:
javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScrptEngineImpl.$() is applicable for argument types: ...
Possible solutions: is(java.lang.Object), any(), get(java.lang.String), any(groovy.lang.Closure), tap(groovy.lang.Closure)......
(将打印我是一个字符串,这是一个值栏
)
如果希望在普通代码中(字符串之外)使用结果变量的值,可以按原样使用该值:
def foo = "bar"
println "I am a string and this is a value ${foo}"
(将以毫秒为单位打印当前时间)
至于您的代码,我们需要更多的上下文来更详细地回答您的问题。就像前面提到的注释一样,我们需要了解您使用的是什么方法/代码的一部分,以及结果变量的设置位置和方式等。在groovy字符串中要使用dollar curly${}
语法:
javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScrptEngineImpl.$() is applicable for argument types: ...
Possible solutions: is(java.lang.Object), any(), get(java.lang.String), any(groovy.lang.Closure), tap(groovy.lang.Closure)......
(将打印我是一个字符串,这是一个值栏
)
如果希望在普通代码中(字符串之外)使用结果变量的值,可以按原样使用该值:
def foo = "bar"
println "I am a string and this is a value ${foo}"
(将以毫秒为单位打印当前时间)
至于您的代码,我们需要更多的上下文来更详细地回答您的问题。就像前面提到的注释一样,我们需要查看您使用的是什么方法/代码的一部分,以及结果变量的设置位置和方式等。不要内联到Groovy脚本中,因为:
它与Groovy冲突
因此,在下一次迭代中,您将从第一次迭代中获得值
因此,如果您想将变量值打印到日志文件中,您应该对类实例使用vars
速记,例如:
println(someMethod())
def someMethod() {
def result = System.currentTimeMillis()
result // returns result, no curlies needed
}
更多信息:不要内联到Groovy脚本中,因为:
它与Groovy冲突
因此,在下一次迭代中,您将从第一次迭代中获得值
因此,如果您想将变量值打印到日志文件中,您应该对类实例使用vars
速记,例如:
println(someMethod())
def someMethod() {
def result = System.currentTimeMillis()
result // returns result, no curlies needed
}
更多信息:您如何设置结果
值?您如何设置结果
值?