How to get variable in Flexible File Writer in JMeter

WePython 1 Months+

I was testing service with JMeter. I need to write the phone number into a CSV file and the phone number is a variable as you can see in the Debug Sampler. I was using Flexible File Writer for writing the file. Here is the documentation of Flexible File Writer in the last section they described how to use a variable but I'm not getting it. Any example would be great help!

Here is my Flexible File Writer config

-----------------Answer-----------------
  1. Add the next line to user.properties file:

     sample_variables=phone
    
  2. Restart JMeter to pick up the change

  3. Instead of ${phone} in the Flexible File Writer use variable#0

  4. If you need to write more than one variable:

    sample_variables=phone,device_id
    

    and then in the Flexible File Writer:

    • variable#0 - instead of ${phone}
    • variable#1 - instead of ${device_id}

More information:

  • Configuring JMeter
  • Sample Variables
  • Using the JMeter Flexible File Writer Plugin

Previous : Clicking Windows Calculator buttons with AutoItLibrary for Robot Framework and RIDE
Next : Maven is not running any tests called using testng suitexml files in POM.xml