我正在尝试使用 JMeter 实现测试计划。
我想做以下场景: 在同一个线程中我有 2 个 HTTP 请求
HTTP Request login
HTTP Request getStudentsName
事情是,除非我先运行登录,否则 HTTP 请求 getStudentsName 无法完成,所以假设我想为 1 个用户执行登录,然后为 50 个用户执行getStudentsName。
如果我将 login 和 getStudentsName 放在两个不同的线程中,login 会成功,但 getStudentsName 会失败。
我的问题是我可以在同一个线程中实现这个示例吗?或者有其他帮助吗?
谢谢。
最佳答案
要仅运行登录一次,请使用 Once Only Controller通过右键单击 UI 上的“插入父级”作为其父级。
The Once Only Logic Controller tells JMeter to process the controller(s) inside it only once per Thread, and pass over any requests under it during further iterations through the test plan.
关于java - jmeter在同一线程中针对不同的http请求使用不同的线程数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48946948/