Jmeter-通过一次调用使用GET/POST [英] Jmeter - Using GET/POST with single call

查看:93
本文介绍了Jmeter-通过一次调用使用GET/POST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于测试目的,我需要测试同一端点是否能够同时使用GET/POST http方法.什么是最简单的方法,如何在不创建脚本副本的情况下做到这一点?

For the purpose of my test, i need to test the same endpoint is capable of using both GET/POST http method. What is the easiest way, how i can do it without creating duplicates of the script?

推荐答案

您通常可以参数化 HTTP请求方法通过创建具有以下内容的简单CSV文件:

You can normally parameterize the HTTP request method by creating a simple CSV file with the following contents:

method
GET
POST

完成后,您可以添加 CSV数据集配置元素并进行设置像这样

once done you can add a CSV Data Set Config element and set it up like:

,并且在您的 HTTP请求采样器中,只需使用${method} JMeter变量

and in your HTTP Request sampler just use ${method} JMeter Variable

就是这样,您现在可以运行您的请求,它将使用不同的方法两次访问端点:

That's it, you can now run your request and it will hit the endpoint twice using different methods:

这篇关于Jmeter-通过一次调用使用GET/POST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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