怎样让xml文件的属性值随机生成
如:<request><jabber type="raw" ack="no_ack" data="<message id='a98d8bed-ac21-4851-a8b3-6e4bd6523174' to='xm@dc01' ><//request> id为随机值,而不是固定值
解答:
首先dtd文件里要有random属性
然后设置random="true"
然后设置random="true"
如
<thinktime min="2" max="10" random="true"></thinktime>
这时 thinktime的取值为2-10之间
If you want to use a fixed seed for the random generator,you can use the seed option,like this (by default,tsung will
use the current time to set the seed,therefore random numbers should be different for every test)
use the current time to set the seed,therefore random numbers should be different for every test)
如果你想使用一个固定的种子随机发生器,你可以使用种子标签option,tsung使用当前时间,设置种子,这样随机数每次都不一样
<option name="seed" value="42"/>
搞定
搞定
前提条件,解析此xml的工具或软件得支持random关键字,并对其进行随机策略处理。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。