Sankaranand
Sankaranand

Reputation: 89

Add unique runid to .jtl file for every Jmeter run

I am running below jmeter command using power shell

$runid =$build_number
jmeter -Jsample_variables=$runid -n -t test.jmx -l result.jtl

In the .Jtl result , I could see column added with build_number value as column name and column values are empty.

Upvotes: 1

Views: 569

Answers (1)

Dmitri T
Dmitri T

Reputation: 167992

You declare the Sample Variable but not assigning any value to it

  1. Add User Defined Variables configuration element to your test plan and define runid variable there using ${__P(runid,)} function as the value:

    enter image description here

  2. Amend your JMeter startup command as:

    jmeter -Jsample_variables=runid -Jrunid=123456 -n -t test.jmx -l result.jtl
    
  3. That's it, once test finishes you should be able to see the runid column with the appropriate value:

    enter image description here

Upvotes: 1

Related Questions