fellow QAs! Background - apache jmeter 4.0 is used in combination with ChromeWebDriver for loadtesting a jsf web application. In jmeter numerous JSR223\Groovy samplers are used to control locally started chromedriver by executing org.openqa.selenium methods. My current task is to implement pacing. I took this tutorial - https://www.blazemeter.com/blog/how-to-easily-implement-pacing-jmeter as a basis, and it looks to work ok at first, but there's one problem, kind of a strange one, that I can't defeat. When I put several jsr223 samplers under a transaction controller, and place another JSR right after it, with this code:
//Sets the pacing length based on the last requests response time. 4500 is the time in ms
Long pacing = 4500 - prev.getTime();
//If the response time is less than 4500 ms, set the delay value to myDelay
if ( pacing > 0 )
{
//iPacing is equal to the int value of pacing if pacing is not equal to null, otherwise iPacing is null
Integer iPacing = pacing != null ? pacing.intValue() : null;
log.info(String.valueOf(iPacing));
vars.put("myDelay", String.valueOf(iPacing));
return iPacing;
}
//The response time is greater than or equal to 4500 ms, set myDelay to 0
else
{
vars.put("myDelay", "0");
return 0;
}
the prev.getTime() method returns execution time only for the last sampler under a transaction controller, not the total time! I tried setting and unsetting "Generate parent sample" checkbox - result is still the same.
Here is how the scenario looks:
Any help will be greatly apreciated!