Bastian
Bastian

Reputation: 1237

How to display thread group name in JMeter log and in step

I have a problem when I run many tests in the same time in a single test plan. the problem is that in the logs I saw errors but I can not figure out to which test they belongs to. (all the tests have some common steps).

  1. How can I see in logs to which test it refers to?

  2. I want in the name of the step to write the name of test, but not manually, is there a function to write the test name. for example if the test name is "add to array yellow", and the step name is "add one".

I would like to call the test add to array yellow + add one.

Is it possible in JMeter?

Upvotes: 1

Views: 4495

Answers (3)

Vivek
Vivek

Reputation: 11

You can add ${__threadGroupName} in the HTTP request sampler name

Screenshot

Upvotes: 0

Ori Marko
Ori Marko

Reputation: 58772

Test Plan should be get using ${__TestPlanName}.

Step name should be get using ${__samplerName()}

so you can use ${__TestPlanName} ${__samplerName()}

To get Thread Group Name In JSR223 Element you can use

ctx.getThreadGroup().getName()

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168052

Normally you should have threadName column in the .jtl results file which contains thread group name, thread number and iteration number

JMeter JTL Results File

This should provide you enough information regarding which sampler has failed.

If you don't see threadName column in the .jtl results file - something is wrong with your result save configuration, to enable saving thread name you can add the next line to user.properties file:

jmeter.save.saveservice.thread_name=true

More information: Useful JMeter Properties: Save Results. Save the World

Upvotes: 1

Related Questions