使用jmeter模拟200个用户,每个用户都有唯一的登录名 [英] simulate 200 users with jmeter, each with unique logins

查看:811
本文介绍了使用jmeter模拟200个用户,每个用户都有唯一的登录名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用jMeter,并且计划进行一些负载测试.我的GUI有效地为一个用户登录了该站点.登录发布操作上发回的参数之一是在表单创建时设置的creationTime值.

I've just started using jMeter and the plan is to do some load testing. I have the GUI effectively logging into the site for one user. One of the params sent back on the login post action is a value for creationTime that is set on form creation.

问题在于,我们的应用程序会检查上次登录时间,如果表单上的时间早于上次登录时间,则会拒绝您.这使我无法在"jMeter HTTP请求参数"框中对creationTime进行硬编码.

The problem is that our app checks against the last login time and refuses you if the time on the form is earlier than the last login time. This is preventing me from hardcoding the creationTime in the jMeter HTTP Request Parameters box.

由于目标是测试登录的可伸缩性,而不是测试200名用户快速登录和注销系统的能力,因此,我需要找出一种拥有大量用户的方法.我会为每个用户创建一个登录组吗?我可以尝试采取哪些策略?

Since the object is to test the login scalability, not the ability to run through 200 users logging in and out of the system quickly, I need to figure out a way to have a bunch of users. Would I make a login group for each user? What are the strategies I could try to accomplish this?

推荐答案

不得不解决数十次类似的问题,我提供了一些解决方案:

Having had to conquer similar problems dozens of times, I have a few solutions to offer:

  1. 如果在帖子中给creationTime一个空白值会怎样?
  2. 如果需要一个值,请发送当前时间戳: http://jmeter .apache.org/usermanual/functions.html #__ time
  3. 如果需要系统提供的令牌,请将您的请求拆分为以下内容:
  1. What happens if you give creationTime a blank value on the post?
  2. If a value is required, send the current time stamp: http://jmeter.apache.org/usermanual/functions.html#__time
  3. If a system provided token is required, split your request into the following:

Step 1: GET the login page (no parameters are required)
Step 2: As a post processor of Step 1, use a REGEX to extract the token (creationTime)
Step 3: POST the login page, using the value from the REGEX

4.为将来的一年使用creationTime的硬编码值.

4. Use a hardcoded value for creationTime that is a year in the future.

这篇关于使用jmeter模拟200个用户,每个用户都有唯一的登录名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆