0

I have a task where I need to run one .jmx file with different arguments. I have completed that script but the problem is while setting it into batch file. I need to run multiple commands into one batch file. This is how I have written my batch file but it seems to run only first command.

:begin
cd C:\abc\apache-jmeter-2.11\bin
jmeter -n -t API_Monitoring.jmx  -Jport=91 -Jhost=xxx -JserviceName=aaa
jmeter -n -t API_Monitoring.jmx  -Jport=91 -Jhost=yyy -JserviceName=bbb
jmeter -n -t API_Monitoring.jmx  -Jport=90 -Jhost=zzz -JserviceName=ccc
jmeter -n -t API_Monitoring.jmx  -Jport=91 -Jhost=ppp -JserviceName=ddd
goto begin

I tried with start and wait too. But nothing works. Can anyone please help how to write such batch?

Namrata
  • 43
  • 3
  • 8
  • 3
    How exactly were you using start? You were probably really close! (Also, do you need to run those four commands one at a time or all at once?) – SomethingDark Jan 30 '17 at 12:22
  • One at a time. jmeter start \wait -n -t API_Monitoring.jmx -Jport=91 -Jhost=ppp -JserviceName=ddd Like this, But this was starting all the scripts simultaneously – Namrata Jan 31 '17 at 04:18
  • Well, what is `jmeter`? Is it an executable or a script? We could see that if you would have specified the file name with file extension which would be also better for Windows command interpreter because in this case `cmd.exe` would not need to search around for a file matching pattern `jmeter.*` in current directory and all directories defined in environment variable `PATH` and having a file extension defined in environment variable `PATHEXT`. Perhaps it helps if the command `call` is put at beginning of each `jmeter` command line although this command is usually needed only for batch files. – Mofi Jan 31 '17 at 06:58
  • Possible duplicate of [Wait for multiple applications run asynchronously from batch file to finish](http://stackoverflow.com/questions/18758502/wait-for-multiple-applications-run-asynchronously-from-batch-file-to-finish) – Kiril S. Feb 01 '17 at 13:43
  • Possible duplicate of [Only first lambda update statement is running in my batch file](https://stackoverflow.com/questions/51435269/only-first-lambda-update-statement-is-running-in-my-batch-file/51446411#51446411) – Stephan Jul 23 '18 at 14:11

1 Answers1

0

you can try:

:begin
cd C:\abc\apache-jmeter-2.11\bin
call jmeter -n -t API_Monitoring.jmx  -Jport=91 -Jhost=xxx -JserviceName=aaa
call jmeter -n -t API_Monitoring.jmx  -Jport=91 -Jhost=yyy -JserviceName=bbb
call jmeter -n -t API_Monitoring.jmx  -Jport=90 -Jhost=zzz -JserviceName=ccc
call jmeter -n -t API_Monitoring.jmx  -Jport=91 -Jhost=ppp -JserviceName=ddd
goto begin
Partha
  • 1
  • 1