加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

jmeter3.0 webservice接口测试 每个线程发送不同的数据

发布时间:2020-12-16 21:59:25 所属栏目:安全 来源:网络整理
导读:和http请求参数类似,webservice直接将Soap/XML-RPC Data报文中需要变化的值替换为函数即可。 ${__CSVRead(G:tmpsendMsg.txt,0)},第一个线程读第一行第一列,第二个线程读第二行第一列。 先将完整报文写入Soap/XML-RPC Data中,红色部分是要变化的部分 ?x

和http请求参数类似,webservice直接将Soap/XML-RPC Data报文中需要变化的值替换为函数即可。

${__CSVRead(G:tmpsendMsg.txt,0)},第一个线程读第一行第一列,第二个线程读第二行第一列。

先将完整报文写入Soap/XML-RPC Data中,红色部分是要变化的部分

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sendMsg soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://server.webservice.xt.java.com/"><arg0 xsi:type="xsd:string">{&quot;time&quot;:&quot;20161124113553&quot;,&quot;duration&quot;:&quot;2&quot;,&quot;serialId&quot;:&quot;ycwp201611241135533526&quot;,&quot;length&quot;:4704,&quot;format&quot;:&quot;amr&quot;,&quot;type&quot;:2,&quot;deviceId&quot;:&quot;123456789&quot;}</arg0></ns1:sendMsg></soapenv:Body></soapenv:Envelope>

更改后

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sendMsg soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://server.webservice.xt.java.com/"><arg0 xsi:type="xsd:string">{&quot;time&quot;:&quot;20161124113553&quot;,&quot;deviceId&quot;:&quot;${__CSVRead(G:tmpsendMsg.txt,0)}&quot;}</arg0></ns1:sendMsg></soapenv:Body></soapenv:Envelope>

完整界面:


在指定路径配置好请求中需要的数据,就能看到每个线程发送的数据不一样了。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读