简体   繁体   English

Jmeter-登录后并行执行HTTP请求

[英]Jmeter - Parallel execution of HTTP request after Login

Scenario 情境

  • Navigating to a login page which generates session data key which will be used while entering the credentials for login 导航到登录页面,该页面生成会话数据密钥,该会话数据密钥将在输入登录凭据时使用
  • Entering credentials along with sessiondataKey(ie sessiondatakey is a entered as parameter in Jmeter Http Header ) 输入凭证以及sessiondataKey(即sessiondatakey是在Jmeter Http Header中作为参数输入的)
  • Login mechanism provides authorization token 登录机制提供授权令牌
    • Once authorization token is extracted from response ,initialization request is triggered 从响应中提取授权令牌后,触发初始化请求
  • As this a XHR enabled site - multiple requests are triggered all together at same time to API's once response from initialization service is received (Note - Here in every request authorization token which we got previously is sent as a part of Header) 由于这是一个启用XHR的站点-一旦收到初始化服务的响应,API就会立即同时触发多个请求(注意-在这里,我们先前获得的每个请求授权令牌都作为Header的一部分发送)

Question - What should be My Test Plan structure in jmeter where I would like to login with 50 Users (Data referred from CSV datset) - Once Login - Initialization done then fire up all request together. 问题-我要在50个用户中登录的jmeter中的“我的测试计划”结构应该是什么(从CSV数据集引用数据)-登录后-初始化完成后,一起启动所有请求。

Just go for Parallel Controller , your test plan should look like: 只需使用Parallel Controller ,您的测试计划应如下所示:

  • Login 登录
  • Parallel Controller 并联控制器
    • Request 1 请求1
    • Request 2 要求2
    • Request 3 要求3
    • etc. 等等

So Request 1 , Request 2 , etc. will be executed at the same time, each with its own thread. 因此, Request 1Request 2等将同时执行,每个都有自己的线程。

See How to Use the Parallel Controller in JMeter article for comprehensive information if needed. 如果需要,请参阅如何在JMeter中使用并行控制器一文以获得全面的信息。

You can install Parallel Controller using JMeter Plugins Manager 您可以使用JMeter Plugins Manager安装Parallel Controller

JMeter插件并行控制器

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

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