ASai5
14 years agoNew Contributor
LoadUI threads causes a record to be used again
Hi Everybody,
I started using LoadUI recently and I am facing an issue. I have a testsuite with a simple Groovy script that increment a parameter and a request that uses that value.
I started my LoadUI with a rate of 1/sec and Request limits of 5. It worked fine. Then I started increasing the rate to 5/sec and Request Limits to 100. I started seeing some of the records that were already used being used again causing the requests to fails as the records were already in the database.
I would like some help on fixing this issue by having the threads not re-using already used records.
My LoadUI setup is just a Fixed Rate Generator, a SOAPUI runner and Statistics component.
Simple Groovy script to increment my parameter and insert in the Properties:
***
String scounter = '';
Integer icounter = 0;
String dataString = '';
def props = new java.util.Properties();
props = testRunner.testCase.getTestStepByName("Properties");
scounter = props.getPropertyValue('COUNTER');
icounter = scounter.toInteger();
icounter++
scounter = icounter.toString();
props.setPropertyValue('COUNTER', scounter);
length = 32 - scounter.length();
dataString = "55555555555555555500000000000000"
dataString = dataString.substring(0,length)
props.setPropertyValue('CIN', dataString + scounter);
***
I have attached a screen shot. The records were incrementing correctly up to xxxxxx163 but then xxxxxx002.
This should work but I am also thinking about using DataSource or a Groovy script that read from csv file.
I would greatly appreciate your help and/or inputs.
Thanks!
I started using LoadUI recently and I am facing an issue. I have a testsuite with a simple Groovy script that increment a parameter and a request that uses that value.
I started my LoadUI with a rate of 1/sec and Request limits of 5. It worked fine. Then I started increasing the rate to 5/sec and Request Limits to 100. I started seeing some of the records that were already used being used again causing the requests to fails as the records were already in the database.
I would like some help on fixing this issue by having the threads not re-using already used records.
My LoadUI setup is just a Fixed Rate Generator, a SOAPUI runner and Statistics component.
Simple Groovy script to increment my parameter and insert in the Properties:
***
String scounter = '';
Integer icounter = 0;
String dataString = '';
def props = new java.util.Properties();
props = testRunner.testCase.getTestStepByName("Properties");
scounter = props.getPropertyValue('COUNTER');
icounter = scounter.toInteger();
icounter++
scounter = icounter.toString();
props.setPropertyValue('COUNTER', scounter);
length = 32 - scounter.length();
dataString = "55555555555555555500000000000000"
dataString = dataString.substring(0,length)
props.setPropertyValue('CIN', dataString + scounter);
***
I have attached a screen shot. The records were incrementing correctly up to xxxxxx163 but then xxxxxx002.
This should work but I am also thinking about using DataSource or a Groovy script that read from csv file.
I would greatly appreciate your help and/or inputs.
Thanks!