1

Is there a way to write variables from csv input file to the .csv output file?

i have input.csv with

planID |planNum
---- |----
1 | 123456

Also, I have user defined variable: varToFlexibleFileWriter, value: "some value"

I am using flexible File writer to write output file In Record each sample as, I have : ${varToFlexibleFileWriter}|\t|${planNum}|\r\n

but in outfile I see:

userDefinedVar | planNum
some value | ${planNum}

User defined variable is displayed as expected, but there is no value for planNum.

Is there a way to make flexible file writer to write variable values from input file? Thanks

IAmMilinPatel
7,7667 gold badges44 silver badges68 bronze badges
asked Aug 9, 2016 at 11:52
1
  • You can use csv configuration in jmeter Commented May 7, 2017 at 10:39

2 Answers 2

1

You need to add some extra configuration so Flexible File Writer could save your planNum variable.

  1. Add the next line to user.properties file (it is located in JMeter's "bin" folder)

    sample_variables=planNum
    

    JMeter restart will be required to pick the property up. Alternatively you can define the property by passing it via -J command-line argument like:

    jmeter -Jsample_variables=planNum -n -t yourplan.jmx -l results.jtl

  2. Use variable#0 instead of ${planNum} in the Flexible File Writer

References:

answered Aug 10, 2016 at 4:48
0

Every answer I see in all the internet avoids the main question!

How does one write a dynamic values to the output?

Clearly the original author of the thread wanted to submit changing values into the output. (csv, etc...) From every answer I see, the end result is NO, you cannot write changing values to Flexible File Writer!!!

If this had been the intent of the developer, they would had allowed custom ${vars} to be used in the plugin. EVERYTHING is static output. The only dynamic values are the tiny subset of vars that can be used and cannot be modified.

answered Jan 25, 2018 at 8:45
1
  • How does this add to the accepted answer? Commented Jan 25, 2018 at 12:24

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.