Home > OS >  Saving transaction ids of failed responses while running the JMeter load test in Jenkins
Saving transaction ids of failed responses while running the JMeter load test in Jenkins

Time:11-22

There is a Jmeter load test which we would like to run in Jenkins and it will be run for a long time, say 2 hours. I want to capture the transaction ids of all the failed responses and give it to the dev. What is the best way to do this?

CodePudding user response:

Whatever "transaction id" is it should be possible to save it using JSR223 PostProcessor and Groovy language, example code:

if (!prev.isSuccessful()) {
    vars.put('failedTransactionId', 'your-transaction-id-here')
}

Once done you can add the next line to user.properties file:

sample_variables=failedTransactionId

and next time you run your test JMeter will create a new column in the .jtl results file with the value of the failed transaction ID for each failed Sampler.

If you cannot modify user.properties file you can set this sample_variables property value via -J command-line argument like:

jmeter -Jsample_variables=failedTransactionId -n -t test.jmx ....
  • Related