Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
10.0k views
by Master (1.2k points)
edited by

jmx loc = "E:\Abhishek\Performance testing result\abc.jmx"
jtl loc = "E:\Abhishek\Performance testing result\def.jtl"
Jmeter loc = "E:\Abhishek\Performance testing tools\apache-jmeter-3.3\apache-jmeter-3.3\bin"

in cmd i moved to bin loc

1) jmeter -n -t \Abhishek\Performance testing result\abc.jmx  -l \Abhishek\Performance testing result\def.jtl

2) jmeter -n -t abc.jmx -l def.jtl

am getting an error
An error occurred: Unknown arg: testing
errorlevel=1
Press any key to continue . . .

how to resolve this ??

Read more: https://softwaretestingboard.com/qna/2725/

4 Answers

1 like 0 dislike
by Expert (748 points)

first, maintain test result file in bin folder after that run this command and if you want to log then run this command:
jmeter -n -t YourJmeterTestPlan.jmx -l TestResultFile.jtl  -j LogFile.log
 

by Master (1.2k points)
i have one doubt all the files shoud be in bin folder ah ?
(i,e) .jmx, .jtl, .log .
then only this cmd will run
or
only .jtl file shoud be in bin folder ?

Copied from Abhishek's comment.
by Expert (748 points)
First it make jmx file to save all records and if someone want run script in non gui mode for more than 10 users then run {jmeter -n -t YourJmeterTestPlan.jmx}  in cmd .After that TestResultFile maintain in bin folder in apache jmeter directory {-l TestResultFile.jtl} and if you want log then { -j LogFile.log }

>jmeter -n -t YourJmeterTestPlan.jmx -l TestResultFile.jtl  -j LogFile.log    //overall run in cmd
========================================================================
Helpful notes:
-n – Non-GUI mode – This specifies JMeter is to run in non-gui mode
-t – Name of JMX file that contains Test Plan
-l – Name of JTL file (JMeter text logs) to capture log results        
-j – Name of Log file to capture execution logs
by The go-to Tester (190 points)
Thank You @Bharat, I will Try it .
by The go-to Tester (190 points)
edited by
@Bharat

My Test plan Save location = "E:\Abhishek\Performance testing tools\apache-jmeter-3.3\apache-jmeter-3.3\bin\examples"
In this loc am having my .jmx and .jtl file

i moved to bin folder
i run the cmd
jmeter -n -t login.jmx -l sample.jtl

This time am getting
Could not open login.jmx

or
if i give like this

jmeter -n -t E:\Abhishek\Performance testing tools\apache-jmeter-3.3\apache-jmeter-3.3\bin\examples\login.jmx -l E:\Abhishek\Performance testing tools\apache-jmeter-3.3\apache-jmeter-3.3\bin\examples\sample.jtl

An error occurred: Unknown arg: testing
errorlevel=1
by Expert (748 points)
If it possible to share jmx file wtih hide your aplication url .So, i can check in my end
1 like 0 dislike
by
instead of this :- jmeter -n -t \Abhishek\Performance testing result\abc.jmx  -l \Abhishek\Performance testing result\def.jtl

 

It should be like this :-

jmeter -n -t "\Abhishek\Performance testing result\abc.jmx  -l \Abhishek\Performance testing result\def.jtl"
1 like 0 dislike
by
I have understood the issue - jmeter wont run the test if the non gui command has any space in it.
"jmeter -n -t \Abhishek\Performance testing result\abc.jmx  -l "

There is a space between words - Performance and Testing and Result.
You can place the file in any drive or location and try; if there are spaces in the command line, it will throw unknown arg error with the first word after the space.

Remove the spaces and try again.
0 like 0 dislike
by

You must keep your .jmx file in jmeter bin folder and you can change your log file location anywhere you wish.

Just run this after placing the .jmx file in your jmeter bin folder ,

jmeter -n -t abc.jmx -l def.jtl

jmeter -n -t abc.jmx -l C:\users\desktop\def.jtl

jmeter -n -t abc.jmx -l C:\users\desktop\def.Csv

jmeter -n -t abc.jmx -l C:\users\desktop\def.Txt

jmeter -n -t abc.jmx -l C:\users\desktop\def.Xls

If the log file is not there in the location, it will create a new file while running the test.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...