jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SanderW <>
Subject Re: Increment counter by 1 for each test execution.
Date Thu, 08 Jan 2015 14:45:53 GMT
First of all it's not necessary to ask the same question in multiple old

My suggested way is probably not the most efficient 

Create a new testplan with 2 thread groups and on testplan level make sure
"Run Thread Groups consecutively" is checked.

The first thread group is executed with 1 user and loopcount is 1.
The second thread group contains your script and has name

In the first thread group you have a beanshell sampler with the following

// Get the sequence number from file
FileInputStream in = new FileInputStream("C:/runid.txt");
InputStreamReader inr = new InputStreamReader(in);
BufferedReader br = new BufferedReader(inr);
String line1=br.readLine();
props.put("runid", line1);

// Overwrite the old file with a new sequence number
f = new FileOutputStream("C:/runid.txt", false);
p = new PrintStream(f);
p.println(Integer.parseInt(line1) + 1);

Attached is the testplan  Raghu-question.jmx

View this message in context:
Sent from the JMeter - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message