windows 如何让 JMETER 将表单发布到带有 QUERYSTRING 的路径?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7167475/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make JMETER send a form post to a path with a QUERYSTRING?
提问by tresstylez
I'm using JMeter for some performance testing. I've recorded my test case using the proxy, and am running into a snag trying to replay it.
我正在使用 JMeter 进行一些性能测试。我已经使用代理记录了我的测试用例,并且在尝试重放它时遇到了障碍。
Basically, I have a HTTP post and its posting to a page that contains a QUERYSTRING.
基本上,我有一个 HTTP 帖子并将其发布到包含 QUERYSTRING 的页面。
Sampler Path:http://dev.mysite.com/myform.aspx?formfunction=SEARCH
POST DATA:searchitem=dogs
采样器路径:http : //dev.mysite.com/myform.aspx? formfunction= SEARCH
发布数据:searchitem=dogs
Issue that I'm running into is that myform.aspx will be passed the post data, but its not returning the expected response. Its returning a response as if the querystring (?formfunction=SEARCH) wasn't even included.Without the querystring, it runs a default SEARCH, but if the querystring is included, it runs a different search with the searchitem included in the post data.
我遇到的问题是 myform.aspx 将传递发布数据,但它没有返回预期的响应。 它返回一个响应,就好像查询字符串 (?formfunction=SEARCH) 甚至不包括在内。如果没有查询字符串,它会运行默认的 SEARCH,但如果包含查询字符串,它会使用包含在帖子数据中的搜索项运行不同的搜索。
How can I make JMeter recognize the querystring I'm sending in my sampler path??
如何让 JMeter 识别我在采样器路径中发送的查询字符串?
Any help is appreciated.
任何帮助表示赞赏。
Thanks.
谢谢。
jg
jg
采纳答案by BlackGaff
You could try taking the parameter out of the path, and add it as a post data item below.
您可以尝试将参数从路径中取出,并将其添加为下面的发布数据项。
So, in your HTTP request - under "parameters" you should see "searchitem:dogs". click "Add" to create a new parameter, with the name "formfunction" and value "SEARCH"
因此,在您的 HTTP 请求中 - 在“参数”下,您应该看到“searchitem:dogs”。单击“添加”创建一个新参数,名称为“formfunction”,值为“SEARCH”