jmeter -n -t test1.jmx -l test.jtl -e -o test_res 命令
jmter -h
To list all command line options, open a command prompt and type:
jmeter.bat(Windows)/jmeter.sh(Linux) -?
To run Apache JMeter in GUI mode, open a command prompt and type:
jmeter.bat(Windows)/jmeter.sh(Linux) [-p property-file]
To run Apache JMeter in NON_GUI mode:
Open a command prompt (or Unix shell) and type:
jmeter.bat(Windows)/jmeter.sh(Linux) -n -t test-file [-p property-file] [-l results-file] [-j log-file]
To run Apache JMeter in NON_GUI mode and generate a report at end :
Open a command prompt (or Unix shell) and type:
jmeter.bat(Windows)/jmeter.sh(Linux) -n -t test-file [-p property-file] [-l results-file] [-j log-file] -e -o [Path to output folder]
To generate a Report from existing CSV file:
Open a command prompt (or Unix shell) and type:
jmeter.bat(Windows)/jmeter.sh(Linux) -g [csv results file] -o [path to output folder (empty or not existing)]
To tell Apache JMeter to use a proxy server:
Open a command prompt and type:
jmeter.bat(Windows)/jmeter.sh(Linux) -H [your.proxy.server] -P [your proxy server port]
To run Apache JMeter in server mode:
Open a command prompt and type:
jmeter-server.bat(Windows)/jmeter-server(Linux)
动态指定 线程和循环次数、url和端口号
jmeter -JthreadCount=2 -Jcycle=2 -Jurl=www.baidu.com -Jport=80 -n -t cmd.jmx -l cmd.jtl
当然了,我们也不会傻到去修改这些配置文件,这多麻烦。JMeter提供了方法可以动态修改属性,在命令行使用 -J 来指定JMeter Properties
(jmeter.bat -help | jmeter.sh -help可以看到帮助),使用__P() 函数来获取命令中指定的属性值。
JMeter 命令行通过-D来指定System Properties,类似于Jdk中我们用-D来指定一些系统属性,比如开启JMX远程监控。
在JMeter脚本中我们用__property()函数来获取,比如-Durl=172.16.3.219在测试计划中用KaTeX parse error: Expected group after '_' at position 2: {_̲_property(url,,…{__property(port),}来获取;
参考 https://blog.csdn.net/Gorky1112/article/details/80826577
参考
https://blog.csdn.net/Gorky1112/article/details/80825116
https://www.cnblogs.com/dancy0dante/p/10065604.html