本文介绍了在JMeter中乘以登录请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JMeter通过Web服务加载数据.我需要从JMeter登录一次,然后需要从CSV文件读取ID,并为每个ID调用HTTP请求.

I use JMeter to load data using web services. I need to login from JMeter once, then I need to read ids from CSV file and call HTTP request for each id.

我当前的配置如附图所示.

My current configuration is as in the attached picture.

问题在于,在这种情况下,将为每个HTTP请求调用登录.我想更改它,因此一开始它只会被调用一次.在JMeter中执行此操作的最佳方法是什么?

The problem is that in this case login is called for each HTTP Request. I want to change it, so it will be called only once at the beginning. What is the best way to do it in JMeter?

推荐答案

右键单击登录->插入父级->逻辑控制器-> 仅一次控制器:

Right click on login -> Insert Parent -> Logic Controller -> Once Only Controller:

..

对于需要登录的测试,请考虑将登录请求放置在此控制器中,因为每个线程只需要登录一次即可建立会话.

For testing that requires a login, consider placing the login request in this controller since each thread only needs to login once to establish a session.

这篇关于在JMeter中乘以登录请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 00:51