jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Flik Shen <Flik_S...@infosys.com>
Subject Need help for scripting
Date Fri, 30 Jul 2010 09:36:39 GMT
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-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message