我想通过 iMeter Soap/XML-RPC 数据测试 SOAP 功能。逻辑很简单,我正在传递一个用户 ID 并想取回用户配置文件。我想测试100个用户,用户id从1到100。我想创建50个线程,每个线程运行这100个id 2小时。我的问题是如何让 jMeter 调用所有这 100 个用户请求。请求 XML 是这样的。我应该只创建 100 个 id 从 1 到 100 的 xml 请求吗?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://server.smartleads.alliancetech.com" xmlns:data="http://data.post.server.smartleads.alliancetech.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<ser:getRegistration>
<ser:aaGetRegReqObj>
<data:action>0</data:action>
<data:version xsi:nil="true"/>
<data:debug>true</data:debug>
<data:id>55</data:id>
</ser:aaGetRegReqObj>
</ser:getRegistration>
</soapenv:Body>
</soapenv:Envelope>
最佳答案
有很多方法可以实现您的目标。其中一些:
- 使用__counter()功能
- 使用配置元素 - Counter
例如,如果您要使用计数器,请按如下方式配置:
然后,在您的请求中使用指定的引用名称:
<ser:aaGetRegReqObj>
<data:action>0</data:action>
<data:version xsi:nil="true"/>
<data:debug>true</data:debug>
<data:id>${userId}</data:id>
</ser:aaGetRegReqObj>
关于xml - 具有多个请求的 jMeter Soap 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21321238/