Hello Jessie! Can you be more specific about what you want to do? Do you mind giving an example workflow across the overall k6 test life cycle?
An early guess:
-
In the
init
stage, export the users as a CSV. -
(Still in
init
), combinepapaparse
with aSharedArray
to turn the CSV file into an array that your VUs can reference. -
In the default function, run your VU code and use the CSV-turned-array data as you wish.
If you want to write the API response to a file, you may need to use an extension.
This post explains why, and links some viable extensions: Write data to file - #2 by imiric
I hope that puts you on the right track! If not, at least that’s two for the process of elimination .