JMeter Write to file script is duplicating print

杀马特。学长 韩版系。学妹 提交于 2019-12-13 03:00:19

问题


I'm having a problem with the CSV generated, it duplicates or iterates the process of printing.

Code of printing to CSV:

CSV file generate with null record:

It shows to values PASSED and null, I'm only expecting the value with PASSED.

Don't know where the null value came from, also in the Debug Sampler the message variable only contains PASSED , did not see any null .


回答1:


When you use post processor for specific sampler, make sure it will execute only once by putting it under the Sampler, otherwise it can execute for other samplers in its hierarchy which you will not expect

If you want it to execute after assertions, change to Beanshell/JSR223 Sampler after your Sampler so it will be executed once after all assertions.

See JMetet's Execution order:

..Sampler

Post-Processors> (unless SampleResult is null)

Assertions (unless SampleResult is null)..



来源:https://stackoverflow.com/questions/51187983/jmeter-write-to-file-script-is-duplicating-print

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!