简体   繁体   中英

How to pass different values from a CSV parameter file

Please could someone tell me how I can pass parameter values to.json body: I have a.csv data file like: AB C

and I need to pass only data A for the request and sometimes both A & B in the next request and sometimes send all 3 and so on… Thanks, N

  • If you're using CSV Data Set Config - given default Sharing Mode of All threads each JMeter thread will read next line on each iteration. If you're OK with this - you can declare 3 variables but use 1 or 2 of them depending on the nature of the request.
  • If you're using __CSVRead() function - it's you who chooses which column to read and when to proceed to the next line
  • Absolute freedom provides __groovy() function where you can travel back and forth between rows and, choose whatever column of whatever row and transform the data in any way you can think of. The only disadvantage is that each virtual user will be reading the whole file in memory causing large memory footprint

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM