简体   繁体   English

JMeter:将同步计时器与If Controller一起使用

[英]JMeter: using synchronizing timer with If Controller

My requirement is I want 10 users logging in(using login credentials from CSV) with simultaneous login of 5 users, with each user traversing different paths depending on which user has logged-in. 我的要求是我希望10个用户登录(使用CSV的登录凭据)同时登录5个用户,每个用户根据哪个用户登录而遍历不同的路径。 Below is my Test Plan for the same: 以下是我的测试计划: 测试计划

Below is synchronizing timer settings which I have used: 下面是我使用的同步计时器设置: 同步计时器设置

I have clubbed my requests in a transaction controller since each main request has multiple concurrent sub-requests Plus i want to put requests for all JS, css, image files as one parent request. 我已将我的请求合并到一个事务控制器中,因为每个主请求都有多个并发子请求,而且我想将对所有JS,CSS,图像文件的请求作为一个父请求。 I am considering 1 request to include all the requests within each Transaction controller.: 我正在考虑1个请求,以将每个请求包含在每个Transaction控制器中。: 请求合并到事务控制器中

As per my Test Plan, if my understanding is correct then, 1st user will login and the request continues to "If controller" of User1. 根据我的测试计划,如果我的理解是正确的,则第一个用户将登录,并且请求继续到User1的“ If controller”。 Here requests will wait till 5 requests have been queued as per setting done in synchronizing timer and all the 5 requests will be sent to the server at one time. 在这里,请求将一直等到按照同步计时器中的设置将5个请求排入队列,并且所有5个请求将一次发送到服务器。 Then 2nd user will login and the requests of the second user will be processed and so on. 然后,第二个用户将登录,第二个用户的请求将被处理,依此类推。

The above test plan executes successfully if synchronizing timer is not used. 如果不使用同步计时器,则上述测试计划将成功执行。 Once I use the synchronizing timer, my test plan execution continues indefinitely. 一旦使用了同步计时器,我的测试计划就会无限期地继续执行。

As per my understanding of synchronizing timer, the processing should continue since I have used timeout value of 200000 MilliSecs. 根据我对同步计时器的了解,由于我使用了200000 MilliSecs的超时值,因此处理应该继续进行。 I am unable to understand why on using synchronizing timer the Test Plan hangs. 我不明白为什么在使用同步计时器时测试计划会挂起。

What i actually want is first all 10 users should login with 5 simultaneous logins and then each user continue with their respective requests as per the condition specified in the If Controller(${__groovy(vars.get("username") == "user1" )}), with 10 simultaneous requests. 我真正想要的是首先所有10个用户应同时登录5次,然后每个用户按照If Controller($ {__ groovy(vars.get(“ username”))==“ user1 “)}),同时请求10个。

So, how do i design my Test Plan along with use of synchronizing timer to achieve the desired result? 那么,我如何设计我的测试计划以及使用同步计时器来达到期望的结果?

I will greatly appreciate inputs from seasoned JMeter experts. 我将非常感谢经验丰富的JMeter专家的意见。 Thanks! 谢谢!

It seems the you want the synchronizing timer to work specifically when 10 users are entering the if controller. 似乎您希望同步计时器在10个用户进入if控制器时专门工作。

Because Timers are executed before every Samplet in scope, 由于计时器是在作用域中的每个Samplet之前执行的,

timers are processed before each sampler in the scope in which they are found; 在发现它们的范围内,在每个采样器之前处理定时器;

In your case you just need to move timer under request 1 inside controller. 在您的情况下,您只需要在控制器内的请求1下移动计时器即可。

Currently you are trying to sync all samplers in flow, and you don't need to wait on every sampler 当前,您正在尝试同步流中的所有采样器,而无需等待每个采样器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM