将参数传递给JMeter [英] Passing parameters to JMeter

查看:81
本文介绍了将参数传递给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?

推荐答案

这是一个发布请求,因此请将此名称值以json格式传递到主体数据中(单击主体数据选项卡)

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

其他方法:

尝试使用与快照2(由您随附)中传递的参数相同的参数将方法更改为 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屋!

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