1
votes

I have script that I am using to create users for my Load test. In the request, I am passing username along with other parameters and the response will be userid.

What I want to save username from the request and userid from the response in the same csv file, such that output looks something like:

username1,userid1
username2,userid2

Is this possible in jMeter?

2

2 Answers

1
votes

The easiest way is to add a line sample_variables=username,userid (without spaces!) to bin/jmeter.properties. Then you can use any of standard listeners to save csv log file. Your jmeter variables ${username} and ${userid} would be there as new columns.

1
votes

I suppose login is in csv and extracted using csv dataset, so:

  • add a regexp extractor or Css/Jquery extractor to extract the variables userid

  • then use a JSR223 Post Processor with groovy and write in it the code that writes the 2 variables, you can access them using:

vars.get("userid")

and

vars.get("login")

if your variables are called userid and login