将参数传递给 JMeter [英] Passing parameters to JMeter
问题描述
我可以通过 Jmeter 成功传递参数,只要我像这样将它们嵌入到路径中:
但是当我尝试使用 GUI 添加它们时,它不起作用:
我尝试过编码/取消编码的组合,以及添加?"到路径,但结果是一样的 - 服务器回复缺少所需的参数.有什么想法吗?
I can successfully pass parameters through Jmeter as long as I embed them in the path like so:
But when I try to add them using the GUI, it doesn't work:
I have tried combinations of encode/unecode, as well as adding "?" to the path, but the result is the same - the server replies that the required parameter is missing. Any ideas?
推荐答案
这是一个 post 请求,所以将此名称值以 json 格式传递到 Body 数据中(单击 body 数据选项卡)
This is a post request so pass this name value into Body data (click on body data tab) in json format
{"Taskid": "9000"}
{ "Taskid": "9000" }
或
{Taskid":9000}
{ "Taskid": 9000 }
如果 9000 的类型是字符串,则选择第一个选项,否则选择第二个,最好同时尝试两个选项以检查哪个选项有效
if the type of 9000 is string then choose 1st option other wise 2nd, better to try with both options to check which one is working
其他方法:
尝试将方法更改为 get
使用与在 snapshot2 中传递的相同参数(由您附上)但可能此请求不支持 get
方法然后在在这种情况下,您必须发布
它只能通过传入路径字段(如快照 1 中所示)或正文数据选项卡
try to change the method to get
with same parameters as passed in snapshot2 (attached by you) but it might be possible this request does not supports get
method then in that situation you have to post
it only by passing in the Path field (as shown by you in snapshot 1) or in body data tab
这篇关于将参数传递给 JMeter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!