我想在非GUI模式下运行JMeter(从命令行)。
我在许多地方看到过,包括官方文档在内,以下命令将实现我的目的:
jmeter -n –t test.jmx -l testresults.jtl
然而,我在“t”参数上遇到了非法参数异常。请参见下面的控制台输出: 以下是保存在jmeter.log中的输出:
2016/08/09 14:41:59 INFO - jmeter.util.JMeterUtils: Setting Locale to en_GB
2016/08/09 14:41:59 INFO - jmeter.JMeter: Loading user properties from: C:\apache-jmeter-3.0_src\apache-jmeter-3.0\bin\user.properties
2016/08/09 14:41:59 INFO - jmeter.JMeter: Loading system properties from: C:\apache-jmeter-3.0_src\apache-jmeter-3.0\bin\system.properties
2016/08/09 14:41:59 FATAL - jmeter.JMeter: An error occurred: java.lang.IllegalArgumentException: Unknown arg: –t
at org.apache.jmeter.JMeter.initializeProperties(JMeter.java:746)
at org.apache.jmeter.JMeter.start(JMeter.java:385)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:259)