Reputation: 14426
Can someone shed some light on how to structure JMeeter for the requirement below:
I have to send two requests.
Currently, I have one "Thread Group" and two "HTTP Requests" under it. One is to get the data (step 1 above) and the 2nd one is to generate 5 requests (possible?).
I am using "Synchronizing timer" to generate 5 requests simultaneously. I know I can create "CSV data Config" element and generate a CSV from the 1st request and write 5 tokens into this CSV. But I am not sure if automatically generates 5 requests simultaneously.
Upvotes: 2
Views: 3153
Reputation: 1733
This can not be done by using CSV Data set config alone, you will have to write some code using Beanshell Sampler
Thread 1
See the sample code below to write your data to CSV file
`import java.io.FileWriter;
import java.io.IOException;
String ID = vars.get("id");
String Pass_wd = vars.get("password");
//Change the file path below
FileWriter writer = new FileWriter("F:\test_20140526.csv", true);
if (ID != "")
{
writer.append(ID);
writer.append(',');
writer.append(Pass_wd);
writer.append('\n');
writer.flush();
}
writer.close();`
Thread 2
Note: Click on Test Plan, Check/select setting "Run Thread Groups Consecutively"
Hope this will help.
Upvotes: 1