问题
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