如何在Jmeter中将参数从一个HTTP请求发送到另一个 [英] How to send parameters from one http request to other in jmeter

查看:578
本文介绍了如何在Jmeter中将参数从一个HTTP请求发送到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用JMeter测试Web应用程序.

I want to test a web application using JMeter.

我想知道如何将参数从一个http请求传输到另一个请求,我的Web应用程序有一个登录页面,并且已经发送了用户名和密码,这是我面临的问题.

I want to know how to transfer parameters from one http request to other, my web app has a login page and I have send my username and password, I am facing problem in this.

推荐答案

在jmeter中测试登录,这是通过文本或csv文件传递参数的正确方法,请执行以下步骤,

Testing of login in jmeter, the proper way to pass the parameter via text or csv file, do the following steps as,

1.创建一个包含用户名和密码的文本文件(或csv文件),用逗号分隔.将此与测试计划放在同一目录中,

1.Create a text file (or csv file) containing the user names and passwords, separated by commas. Put this in the same directory as your test plan as,

2.将CSV数据集配置元素添加到测试计划.将变量命名为USER和PASS.另外,在该元素的文件名中添加一个路径(我确保检查了文件路径),

2.Add a CSV DataSet configuration element to the test plan. Name the variables USER and PASS. also,Add a path to the filename in that element (I made sure to check the file path) as,

3.在登录(HTTP请求)采样器"中,用$ {USER}替换登录名,用$ {PASS}替换密码,

3.Replace the login name with ${USER} and the password with ${PASS} on the Log in (HTTP Request) Sampler as,

希望这对您有帮助,

这篇关于如何在Jmeter中将参数从一个HTTP请求发送到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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