Generate 'Random number' variables in JMeter

偶尔善良 提交于 2021-02-18 11:08:11

问题


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: 2323 thread2: 3334 thread3: 5643

Please refer to images below:

image1image2


回答1:


Use Random JMeter function

${__Random(0000,9999)}

The random function returns a random number that lies between the given min and max values.

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


来源:https://stackoverflow.com/questions/45328356/generate-random-number-variables-in-jmeter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!