user3897704
user3897704

Reputation: 1

Jmeter unique session identifier for each time the same test runs

I would like to know if in Jmeter, I have a test case that I would like to run 3 times a day, is it possible in the jtl or csv output file, if there is a way to identify the test run. For ex: if I run the test first time for 500 users, the results should specify {some value} as 1. And if I run the same test the 2nd time, then results should specify the {some value} as 2 .... .... If I run the same test 50th time, then results should specify the {some value} as 50.

Is it possible we have a solution that we can customize from jmeter properties? If so please let me know.

Thanks,

Sarathi

Upvotes: 0

Views: 598

Answers (2)

Ophir Prusak
Ophir Prusak

Reputation: 1447

Alternatively, you can use the time function which will simply provide the current timestamp as a variable you can then append to wherever you want.

http://jmeter.apache.org/usermanual/functions.html#__time

Upvotes: 1

Dmitri T
Dmitri T

Reputation: 168082

I'd suggest to do it as follows:

  1. Pass required property to JMeter via -J command line argument as follows:

    jmeter -Jiteration=1 -n -t /path/to/test/script.jmx -l /path/to/results/log.jtl
    
  2. In your test plan refer to that "iteration" property as ${__P(iteration,)} which will take the value from command line wherever is required:

    • sampler name
    • listener result file
    • test parameter
    • etc.

See screenshot below for the demo

iteration property description

JMeter properties can also be specified in jmeter.properties or user.properties files, both usually live under /bin folder of your JMeter installation.

See Apache JMeter Properties Customization Guide for more details on how to get things done using JMeter properties.

Upvotes: 0

Related Questions