您的位置:首页 > 其它

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

2016-11-24 15:33 330 查看
和http请求参数类似,webservice直接将Soap/XML-RPC Data报文中需要变化的值替换为函数即可。

${__CSVRead(G:\tmp\sendMsg.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">{"time":"20161124113553","duration":"2","serialId":"ycwp201611241135533526","length":4704,"format":"amr","type":2,"deviceId":"123456789"}</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">{"time":"20161124113553","duration":"2","serialId":"ycwp201611241135533526","length":4704,"format":"amr","type":2,"deviceId":"${__CSVRead(G:\tmp\sendMsg.txt,0)}"}</arg0></ns1:sendMsg></soapenv:Body></soapenv:Envelope>

完整界面:

在指定路径配置好请求中需要的数据,就能看到每个线程发送的数据不一样了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐