jmeter-user mailing list archives

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

My suggested way is probably not the most efficient 

You can create your own property-file and use that.
Add the line "user.properties=sequencenr.properties" to jmeter.properties

sequencenr.properties has 1 entry: runid=5

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.

In the first thread group you have a beanshell sampler with the following
code:
String value = props.getProperty("sequencenr");
int newvalue = Integer.parseInt(value.trim()) + 1;

// Overwrite the old file with a new sequence number
f = new FileOutputStream("C:/Program
Files/JMeter/2.12/bin/sequencenr.properties", false);
p = new PrintStream(f);
p.println("runid=" + newvalue);
p.close();
f.close();

The second thread group has name Administration${__P(sequencenr)} and
contains your code.

Keep in mind that the changed propery-file will only be used when you
restart JMeter.




--
View this message in context: http://jmeter.512774.n5.nabble.com/Increment-counter-by-1-for-each-test-execution-tp5721603p5721605.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message