2015-12-31 33 views
1

我使用的JMeter這個腳本: enter image description here而控制器不在JMeter的正常工作和BeanShell的預處理工作不正常

內beanShellProcessor我得到這個代碼:

import java.lang.*; 

int timestampInt=0; 
String timestamp=""; 

timestamp=vars.get("timestamp_start"); 
//System.out.println(timestamp); 
timestampInt = Integer.parseInt(timestamp); 
timestampInt+=1; 
timestamp_start=Integer.toString(timestampInt); 
System.out.println(timestamp_start); 

vars.put(timestamp_start,"timestamp_start"); 

我越來越timestamp_start和來自命令行的timestamp_end(${__P(timestamp_start,1451404741)})。 爲了阻止我使用這個條件while循環:

${__javaScript("${timestamp_start}" <= "${timestamp_end}")} 

但是我看到我的代碼不會增加我的時間戳變量它仍然是相同的,你能幫助嗎?謝謝!

+0

恰好在while控件之前檢查'$ {timestamp_start}'和'$ {timestamp_end}'的值,可以在控制器之前插入一個Debug採樣器。我認爲條件沒有達到,線程永遠不會到達BeanShellPreProcessor – BzH

回答