writing comma separated values in jmeter to a txt file and then reuse them

400 views Asked by At

I want to fetch order id from a variable in loop and store them in txt file separated with a comma(eg:"12345,12346,12347) and then use all the values in one go.

I am getting following error while running the script : **Error in method invocation: Method setout( java.io.PrintStream ) not found in class'bsh.Interpreter' **'

This is the variable ordid which i am storing in file

Also it is creating the file in my system but giving error

code i used to create a file

1

There are 1 answers

0
Dmitri T On
  1. You have a typo in your code, I believe it should be setOut
  2. Since JMeter 3.1 you should be using JSR223 Test Elements and Groovy language for scripting
  3. If you will execute your script with > 1 virtual user you will run into the race condition as when 2 or more threads will be writing into the same file it will result in data corruption so consider using i.e. Flexible File Writer for storing the data