简体   繁体   English

Jmeter HTTP请求发送多个xml负载

[英]Jmeter HTTP Request send multiple xml payloads

Is there anyone who was using Jmeter to send multiple HTTP Requests with different bodies? 是否有人在使用Jmeter发送具有不同主体的多个HTTP请求? I need to send 500 HTTP Request using different XML payloads to the API. 我需要使用不同的XML有效负载向API发送500个HTTP请求。

I can create 500 HTTP Request samplers and for each of them use different xml payload, but i think there should be better solution doing that. 我可以创建500个HTTP请求采样器,并且每个采样器使用不同的xml有效负载,但是我认为应该有更好的解决方案。

JMeter provides several ways on requests parametrization. JMeter对请求参数化提供了几种方法。

The most straightforward way is having 500 files with payloads like 最直接的方法是让500个文件具有有效负载,例如

file1.xml
file2.xml
...
file500.xml

And use Counter and Loop Controller combination 并使用计数器循环控制器组合

Another option is using __FileToString and __threadNum functions combination. 另一种选择是使用__FileToString__threadNum函数的组合。

See How to Use JMeter Functions post series for details on how it can be done. 有关如何完成JMeter函数的详细信息,请参见如何使用JMeter函数

Third option is load all 500 files into JMeter Variables and iterate through them in ForEach Controller 第三种选择是将所有500个文件加载到JMeter变量中,并在ForEach Controller中对其进行遍历

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM