Hi,

I want to generate a random id and validate its existing in DB.
I have tried using below components but failed.
Please give me some suggestions.

 1.  BeanShell Sampler, add variable with value 1 into "vars" map by following 
statement.

vars.put("LoopCountNum", "1");

 1.  While Controller with following condition.

${__javaScript(${ LoopCountNum} < 2)}

 1.  JDBC Sampler with following "Select Statement" and output variable 
"DuplicateAmount".

SELECT COUNT('X') AS DuplicateAmount FROM table_user WHERE user_id = XXX

 1.  BeanShell Sampler update "LoopCountNum" according to previous return 
"DuplicateAmount".

if ("0".equals(vars.get("DuplicateAmount"))) vars.put("LoopCountNum", "2");
Item #3 and #4 are children of item #2.
This test plan is executed endlessly.

Please help me to identify the root cause.
Any scripting references or guideline preferred are also welcome.

Thanks and best regards,
Flik

BTW the version of Jmeter is 2.3.4

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

Reply via email to