[英]JMeter Problem with the variable in JSR223 PreProcessor
vars
保存字符串值,您可以在放置值时转换双精度值:
vars.put("unixTimeValue", String.valueOf(a));
You can change your lines 1-14 to:您可以将第 1-14 行更改为:
vars.put("RANDOM_STRING", org.apache.commons.lang.RandomStringUtils.randomAscii(12))
See RandomStringUtils class JavaDoc for more potentially useful functions有关更多潜在有用的功能,请参阅RandomStringUtils 类 JavaDoc
Change your line 20 to:将第 20 行更改为:
vars.putObject("unixTimeValue", sin);
as vars.put()
function accepts only Strings while vars.putObject()
accepts pretty much everything, see JMeterVariables class JavaDoc for more details由于vars.put()
函数只接受字符串,而vars.putObject()
接受几乎所有内容,有关更多详细信息,请参阅JMeterVariables 类 JavaDoc
Since JMeter 3.1 you should be using Groovy language for scripting mainly because Groovy has much better performance comparing to Beanshell, see Apache Groovy - Why and How You Should Use It article for comprehensive explanation with examples 从 JMeter 3.1 开始,您应该使用 Groovy 语言编写脚本,主要是因为与 Beanshell 相比,Groovy 具有更好的性能,请参阅Apache Groovy - Why and How You Should Use It文章以通过示例进行全面说明
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.