我有2个线程组
这两个线程在用户数为1时均可正常工作 现在我想为5个用户发送5个Api请求
例如
var authorizationusercnt = 5;
var apiRequestusercnt = 5;
for(i=0;i<authorizationusercnt;i++)
{
for(j=0;j<apiRequestusercnt;j++)
{
//run api HTTP request
}
}
```
Please help me how can i do this in Jmeter?
答案 0 :(得分:0)
我认为您不需要在那里使用2个线程组,只需将登录并获取令牌的逻辑放在Once Only Controller
下因此,假设您在Thread Group中设置了5个线程和5个循环,您将获得1个授权请求,然后每个用户5个API请求
另外请注意,starting from JMeter 3.1 you should be using JSR223 Test Elements and Groovy language用于脚本编写主要是因为Groovy has much better performance comparing to Beanshell