对于进一步的研究人员:
根据条件(即从json中提取一些数据)开始线程的另一次迭代的简单方法是使用BeanShell Sampler,如上所述。
import org.apache.jmeter.samplers.SampleResult; import org.apache.jmeter.threads.JMeterContext; import org.apache.jmeter.threads.JMeterContext.TestLogicalAction; String statVar = vars.get("statusVariable"); //getting some data for condition check (statusVariable is a variable that has been set previously in the Jmeter JSON Extractor) if(statVar.equals("NOK")){ . //checking the condition SampleResult.setTestLogicalAction(TestLogicalAction.START_NEXT_ITERATION_OF_THRE AD); //Starting thread again (it starts the thread from the beginning, so we may compare this to restart effect)}


