Reputation: 61
I have a sampler inside my test plan. I also have a Simple Data Writer to save requests and responses.
I have entered "Results.xml" to filename field in Simple Data Writer. When I run the test plan, a text file gets generated in the designated path.
Is it possible to change the filename to "Threadgroupname_SamplerName_Results.xml" at runtime?
For example, I have renamed my Thread group to "Search" and the sampler to "CurrencyConverter". Is it possible to save the result in format "Search_CurrencyConverter_Results.xml" during runtime?
Upvotes: 6
Views: 4770
Reputation: 10526
According to the jmeter bugzilla, it is not possible to include the thread group name in the filename because "ResultCollector is initialized in StandardJMeterEngine thread before launch of any ThreadGroup so ctx.getThreadGroup()
will return null."
Upvotes: 0
Reputation: 837
You can use variable placeholders and the __time function in the filename input field to have it dynamically set/changed at runtime. Something like this:
${results.dir}/myresultfile_${__time(YMDHMS)}.xml
Upvotes: 8