Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jmeter - Run test via command line - how to set Loop Count to Infinite

Tags:

jmeter

I'm running jmeter on jenkins starting the test via script such as:

jmeter -n -t ${WORKSPACE}/bin/test/${testscript}.jmx -l ./bin/test/result/${testscript}.jtl -Jhost=${host} -Jthreads=${env.THREADS} -Jiterations=${env.ITERATIONS} -Jrampup=${env.RAMPUP} -Jbuildnumber=${env.BUILD_NUMBER}"

I'd like to pass to the jmeter a parameter which turns the Loop Count to Infinite while starting the .jmx from command line above rather than hardcoding it into the jmx test itself. Reason why is that I want the test to be infinite: true only when it's "scheduled" in jenkins and not when triggered manually.

Does anyone know if the "Loop Count: Infinite" can be passed via script while starting a .jmx test?

Thanks in advance, Vincenzo

like image 401
Enzo Avatar asked Oct 20 '25 09:10

Enzo


2 Answers

As @AngshumanBasak state, -1 define infinite loop, so change your iterations/env.ITERATIONS command line parameter

-Jiterations=-1
like image 137
user7294900 Avatar answered Oct 26 '25 15:10

user7294900


Set

Loop Count = -1

in your jmeter script, to run infinitely. Hope, this resolves your issue.

like image 29
Angshuman Basak Avatar answered Oct 26 '25 15:10

Angshuman Basak