Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance 如何在Jmeter中生成带有前缀的随机数并将其存储到变量中_Performance_Variables_Jmeter_Performance Testing - Fatal编程技术网

Performance 如何在Jmeter中生成带有前缀的随机数并将其存储到变量中

Performance 如何在Jmeter中生成带有前缀的随机数并将其存储到变量中,performance,variables,jmeter,performance-testing,Performance,Variables,Jmeter,Performance Testing,我正在使用JMeter的函数助手对话,我发现了下面的语法- 语法-${u随机(12,99,客户id)} 结果-生成随机值b/w 12到99,将存储在变量“customer id”中 现在的问题是,我必须生成前缀为“test”(比如-test12)的值,并将其存储在变量“customer id”中 如何做到这一点?我不明白您为什么需要它,因为它通常可以与纯文本连接,所以如果您需要test12只需在需要时使用test${customer id}语句 但是,如果您确实需要生成一些静态文本,后跟一个随机

我正在使用JMeter的函数助手对话,我发现了下面的语法-

语法-${u随机(12,99,客户id)}

结果-生成随机值b/w 12到99,将存储在变量“customer id”中

现在的问题是,我必须生成前缀为“test”(比如-test12)的值,并将其存储在变量“customer id”中


如何做到这一点?

我不明白您为什么需要它,因为它通常可以与纯文本连接,所以如果您需要
test12
只需在需要时使用
test${customer id}
语句

但是,如果您确实需要生成一些静态文本,后跟一个随机数,您可以选择如下配置:

${__groovy('test'  + org.apache.commons.lang3.RandomUtils.nextInt(12\,99),customer-id)}
演示:

更多信息: