本文介绍了在 JMeter 中生成“随机数"变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 JMeter 中生成随机数"变量?

  1. 我记录了一个用户旅程
  2. 我已将旅程导入 JMeter
  3. 我必须在我的用户旅程测试用例中输入一个唯一的 4 位 ID
  4. 目前在 jmeter 中默认为 2323

有没有办法生成一个随机的 4didgit 数字?例如线程 1:ID:2323线程 2:3334线程 3:5643

请参考以下图片:

解决方案

使用 Random JMeter 函数

${__Random(0000,9999)}

随机函数返回一个介于给定最小值和最大值之间的随机数.

  • 第三个参数可以作为变量名来保存随机值

Is it possible to generate 'Random number' variables in JMeter?

  1. I have recorded a user journey
  2. I have imported the journey into JMeter
  3. I have to type in a unique 4digit id within my user journey test case
  4. Its default to 2323 at the moment in jmeter

Is there a way of generating a random 4didgit number?For example thread1: ID: 2323thread2: 3334thread3: 5643

Please refer to images below:

解决方案

Use Random JMeter function

${__Random(0000,9999)}

  • Third parameter can be used as a variable name to save random value

这篇关于在 JMeter 中生成“随机数"变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 16:56
查看更多