How to run with various number of user at different times in Jmeter

China☆狼群 提交于 2020-01-22 03:01:11

问题


I want to run login request with different number of users: 10, 20, 30 and generate report with number of users, and response time.

I created CSV file with number of threads: 10, 20, 30

I assigned thread number variable into Number of Thread in Thread group but it does not run.


回答1:


You need to use property, call JMeter batch with different property value, with 10 threads for example

jmeter -JthreadNum=10 -t myJmx.jmx 

And in your Test Plan get the property in your Number of Threads:

${__P(threadNum)}

Notice that the default of the function is 1 so it'll work (with 1 thread) even if you didn't sent any value.

Other solution to add property file with threadNum=10 line with calling command line options to either override or add JMeter property file:

-p, --propfile <argument>
    the jmeter property file to use
-q, --addprop <argument>
    additional JMeter property file(s)

In your case, add to command line -q myprop.properties



来源:https://stackoverflow.com/questions/47343458/how-to-run-with-various-number-of-user-at-different-times-in-jmeter

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