On 6/8/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi all!
>         I am trying to find a solution for being able to change the Loop
> Count for a test without having to hard code the number into the script
> itself.  My test right now has a file with a list in it.  I am using
> StringFromFile in a "User Parameters" element to read in a line from this
> file, store it in a variable, and loop until I get to the end of the file so
> that each iteration I get a new variable value.  My question is, is there a
> way that I can vary the Loop Count based on the number of lines in my file
> without actually having to count the number of lines and changing it by
> hand?

See

http://wiki.apache.org/jakarta-jmeter/JMeterFAQ#head-81e8fdc6d08e5b574a06556f597f788df8ed12fe

On unix, you can do:

jmeter -Jloops=`wc -l list.txt` -n -t test.jmx -l test.jtl

where test.jmx uses ${loops} as the number of loops.

It's not easy to count the number of lines in a file on Windows and
put the answer in a command line, but if you know the value, just
enter it by hand, e.g.

jmeter -Jloops=42 -n -t test.jmx -l test.jtl

But if you just want to stop the test when StringFromFile reaches the
end of the file, then see the final example in the section:

http://jakarta.apache.org/jmeter/usermanual/functions.html#__StringFromFile

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to