在 Jmeter 中,一个 perquisite 采样器请求是否应该是事务控制器的一部分?

In Jmeter, A perquisite sampler request should be a part of transaction controller or not?

用例:

  1. 用户搜索产品并验证响应时间
  2. 用户在搜索结果的分页功能中验证响应时间。
    要检查分页,我们需要搜索。这应该是第二次测试的一部分,还是 jmeter 不需要像 UI 这样的先前请求,我们可以跳过这个只测试分页请求吗?

根据JMeter project main page

JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).

所以如果没有像ViewState or associated Cookies then you should be able to test the pagination without executing the "main" search request and only perform the correlation这样存储客户端状态的动态参数,看看是否还有剩余页面,获取当前页面的编号等

至于是否将其置于事务控制器下-完全取决于您,事务控制器在“继续”先前请求时没有任何逻辑,它只是总结了其子项经过的时间并报告所占用的总量。