我的jmeter测试会生成一个包含唯一ID的http请求.
http://myserver.com/{uniqueId}/
Run Code Online (Sandbox Code Playgroud)
我想为每个线程设置基数(比如35000)和增量,例如我的ids将是35001,35002,35003 ......
http://myserver.com/{base + count}
Run Code Online (Sandbox Code Playgroud)
我看到了__threadnum和__counter的函数但是我怎么做:
我只想使用Beanshell预处理器.
int threadNo = ctx.getThreadNum()+1; //to get the thread number in beanshell
int base = 35000;
int uniqueId = threadNo + base;
vars.put("uniqueId", Integer.toString(uniqueId));
Run Code Online (Sandbox Code Playgroud)
现在,您在下面给出的HTTP请求应该替换值.
http://myserver.com/ $ {uniqueId} /