Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter unknown arg ?t

I'm trying to run JMeter in non-gui mode (from the command line).

I've seen in a number of places, including the official docs, that this following command will do what I want:

jmeter -n –t test.jmx -l testresults.jtl

However, I get an illegal argument exception for the "t" argument. See below for my console output:

Console screenshot showing output from the command

Below is the output saved to 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)
like image 261
dahui Avatar asked Aug 09 '16 13:08

dahui


Video Answer


2 Answers

So the issue was how I was getting the command into the command line.

When I copied and pasted my command, it was copied from a webpage, into notepad, and then into the command line. I wrongly assumed notepad would encode the correct character.

Just a bit confusing as the -n worked but not -t. Silly error!

like image 97
dahui Avatar answered Sep 21 '22 08:09

dahui


Place your script file "TwoMinuteTest.jmx" into your JMeter bin directory and then try this command:

jmeter -n –t TwoMinuteTest.jmx -l testresults.jtl

like image 20
Masud Jahan Avatar answered Sep 18 '22 08:09

Masud Jahan